Built motion from commit 1038d87.|0.0.141
authorDaniele Cinti <daniele.cinti@xcally.com>
Thu, 15 Sep 2016 11:24:56 +0000 (13:24 +0200)
committerDaniele Cinti <daniele.cinti@xcally.com>
Thu, 15 Sep 2016 11:24:56 +0000 (13:24 +0200)
public/app/e497baf3.app.js [moved from public/app/2fcb48e4.app.js with 97% similarity]
public/index.html
release-notes/changelog_0.0.141.txt
server/config/ami/action.js

similarity index 97%
rename from public/app/2fcb48e4.app.js
rename to public/app/e497baf3.app.js
index ddff560..db43a37 100644 (file)
@@ -23,9 +23,9 @@ a.$on("$destroy",function(){e.unsyncUpdates("salesforce_field")}),a.config={auto
 return{name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"voice",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"voice",b.id,f)})["catch"](function(a){console.error(a)})},a.initChatQueues=function(){var a={},c={};return k.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){return{id:a.id,name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"chat",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"chat",b.id,f)})["catch"](function(a){console.error(a)})},a.initMailQueues=function(){var a={},c={};return i.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){return{id:a.id,name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"mail",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"mail",b.id,f)})["catch"](function(a){console.error(a)})},a.initSmsQueues=function(){var a={},c={};return m.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){return{id:a.id,name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"sms",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"sms",b.id,f)})["catch"](function(a){console.error(a)})},a.initFaxQueues=function(){var a={},c={};return l.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){return{id:a.id,name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"fax",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"fax",b.id,f)})["catch"](function(a){console.error(a)})},a.initOpenchannelQueues=function(){var a={},c={};return n.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){return{id:a.id,name:a.name}}),f.query({id:b.id,controller:"allowed",controller2:"openchannel",controller3:"queues"}).$promise}).then(function(a){c.queues=_.map(a,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindPermit(a,c,"openchannel",b.id,f)})["catch"](function(a){console.error(a)})},a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){return a.user=b,a.user.transport=a.user.transport?a.user.transport.split(","):[],a.user.allow=a.user.allow?a.user.allow.split(";"):[],q.get({id:1}).$promise}).then(function(b){a.setting=b})["catch"](function(a){h.error(a)})},a.updateItem=function(){var c=angular.copy(a.user);return delete c.password,delete c.md5secret,c.transport=c.transport.join(","),c.allow=c.allow.join(";"),f.update({id:b.id},c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})},a.updatePassword=function(){var c={newPassword:a.user.newPwd};return g.isAdmin()?c.id=b.id:c.oldPassword=a.user.currentPwd,f.changePassword(c).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})};var v=a.uploader=new e({url:"api/users/"+b.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+c.get("token")}});v.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),a.getModules=function(){return a.associatedModules=[],p.get().$promise.then(function(c){return a.modules=_.filter(c.rows,function(a){return!a.ModuleId}),f.query({id:b.id,controller:"allowed",controller2:"modules"}).$promise}).then(function(b){t(b,a.modules)})["catch"](function(a){h.error(a)})},a.updatePermissions=function(c){c.ModuleId&&r(c),c.SubModules&&c.SubModules.length&&s(c.SubModules,c.status);var e=u([],a.modules);return f.save({id:b.id,controller:"allowed",controller2:"modules"},{modules:e}).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})},v.onSuccessItem=function(b,c){a.user.userpic=c.userpic,a.user.id===g.getCurrentUser().id&&(g.getCurrentUser().userpic=c.userpic),h.show(d.instant("MESSAGE_WELL_DONE"),"success")},v.onErrorItem=function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},v.onCompleteAll=function(){v.clearQueue()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.view",{url:"/view/:id",templateUrl:"app/staff/user/view/view.html",controller:"UserViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.staff.users.view.account",{url:"/account",templateUrl:"app/staff/user/view/view.account.html",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css","assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}}).state("main.staff.users.view.voice",{url:"/voice",templateUrl:"app/staff/user/view/view.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.users.view.permit",{url:"/permit",templateUrl:"app/staff/user/view/view.permit.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}},cache:!1,serie:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/jquery-multi-select/css/multi-select.css","assets/plugins/jquery-multi-select/js/jquery.multi-select.js","assets/plugins/jquery-quicksearch/jquery.quicksearch.js","assets/scripts/components-dropdowns.js"]})}]}}).state("main.staff.users.view.permit.voice",{url:"/voice",templateUrl:"app/staff/user/view/view.permit.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}}).state("main.staff.users.view.permit.chat",{url:"/chat",templateUrl:"app/staff/user/view/view.permit.chat.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.chat"}}}).state("main.staff.users.view.permit.mail",{url:"/mail",templateUrl:"app/staff/user/view/view.permit.mail.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.mail"}}}).state("main.staff.users.view.permit.fax",{url:"/fax",templateUrl:"app/staff/user/view/view.permit.fax.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.fax"}}}).state("main.staff.users.view.permit.sms",{url:"/sms",templateUrl:"app/staff/user/view/view.permit.sms.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.sms"}}}).state("main.staff.users.view.permit.openchannel",{url:"/openchannel",templateUrl:"app/staff/user/view/view.permit.openchannel.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.openchannel"}}}).state("main.staff.users.view.permit.modules",{url:"/modules",templateUrl:"app/staff/user/view/view.permit.modules.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("UserWizardCtrl",["$scope","$location","WizardHandler","xAlert","$translate","User","Setting","Auth",function(a,b,c,d,e,f,g,h){a.initWizard=function(){return a.Auht=h,a.forms={info:void 0,voice:void 0},a.item={role:"user",host:"dynamic",context:"from-sip"},g.get({controller:"internal"}).$promise.then(function(b){a.item.internal=b.value})["catch"](function(a){d.error(a)})},a.next=function(){c.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return f.save(a.item).$promise.then(function(){b.path("/staff/users/list")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.wizard",{url:"/wizard",templateUrl:"app/staff/user/wizard/wizard.html",controller:"UserWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmListCtrl",["$scope","SugarcrmAccount","gridOptions","xAlert","$translate","Modal",function(a,b,c,d,e,f){a.initView=function(){var d={exporterCsvFilename:"sugarcrm_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_REMOTE_ADDRESS"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/sugarcrm/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.get({id:a,controller:"check"}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(a){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.list",{url:"/list",templateUrl:"app/sugarcrm/list/list.html",controller:"SugarcrmListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm",{url:"/sugarcrm",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmAccount",["$resource",function(a){return a("/api/sugarcrm/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmConfiguration",["$resource",function(a){return a("/api/sugarcrm/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("SugarcrmField",["$resource",function(a){return a("/api/sugarcrm/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SugarcrmViewCtrl",["$scope","$http","$stateParams","$translate","$location","$filter","WizardHandler","socket","xAlert","Modal",function(a,b,c,d,e,f,g,h,i,j){a.$stateParams=c,a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:500,scrollInertia:0},a.initConfiguration=function(){a.formsConfiguration={},a.configuration={}},a.goNext=function(){g.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){h.unsyncUpdates("sugarcrm_configuration"),h.unsyncUpdates("sugarcrm_field")}),a.initView=function(){b.get("/api/sugarcrm/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.error(a)})},a.updateItem=function(){b.put("/api/sugarcrm/accounts/"+c.id,a.account).success(function(){i.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/sugarcrm/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("sugarcrm_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){i.error(a)})},a.deleteConfiguration=j.confirm["delete"](function(a){b["delete"]("api/sugarcrm/configurations/"+a).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/sugarcrm/configurations",a.configuration).success(function(a){e.path("sugarcrm/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){i.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/sugarcrm/accounts/"+c.id+"/fields").success(function(b){a.accountFields=_.sortByOrder(f("sugarcrm")(_.toArray(b)),"name","asc"),_.forEach(b,function(a){a.options=_.toArray(a.options)})}).error(function(a){i.error(a)})},a.getConfiguration=function(){b.get("/api/sugarcrm/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,h.socket.on("sugarcrm_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})}).error(function(a){i.error(a)})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){i.error(a)})},a.removeItem=function(a){b["delete"]("api/sugarcrm/fields/"+a.id).success(function(){i.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/sugarcrm/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){i.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/sugarcrm/fields/"+a.id,a).success(function(){}).error(function(){i.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.changeType=function(b){"variable"===b.type?b.content="":"string"===b.type&&(b.VariableId=null),a.updateField(b)},a.changeDescType=function(b){"key_value"===b.type?(b.content="","string"===b.keyType?b.VariableId=null:"variable"===b.keyType&&(b.keyContent="")):"string"===b.type&&(b.VariableId=null,b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){b.content="",a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.options.length>0?c.options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.view",{url:"/view/:id",templateUrl:"app/sugarcrm/view/view.html",controller:"SugarcrmViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.sugarcrm.view.account",{url:"/account",templateUrl:"app/sugarcrm/view/view.account.html"}).state("main.sugarcrm.view.configurations",{url:"/configurations",templateUrl:"app/sugarcrm/view/view.configurations.html"}).state("main.sugarcrm.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/sugarcrm/view/view.configurationSettings.html",controller:"SugarcrmViewCtrl"}).state("main.sugarcrm.view.configuration",{url:"/configuration",templateUrl:"app/sugarcrm/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("SugarcrmkWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler",function(a,b,c,d,e,f){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={}},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){b.post("api/sugarcrm/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/sugarcrm/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.sugarcrm.wizard",{url:"/wizard",templateUrl:"app/sugarcrm/wizard/wizard.html",controller:"SugarcrmkWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("CannedAnswer",["$resource",function(a){return a("/api/answers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers",{url:"/answers",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("AnswerListCtrl",["$scope","$uibModal","CannedAnswer","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"answers.csv",columnDefs:[{name:"key",displayName:"APPLICATION_NAME"},{name:"value"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/answers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.key, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){b.open({animation:!0,templateUrl:"app/tools/answer/list/list.create.modal.html",controller:"AnswerListCreateCtrl"}).result.then(function(b){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("AnswerListCreateCtrl",["$scope","$translate","$uibModalInstance","CannedAnswer","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers.list",{url:"/list",templateUrl:"app/tools/answer/list/list.html",controller:"AnswerListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AnswerViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","CannedAnswer",function(a,b,c,d,e,f,g){a.getAnswer=function(){return g.get({id:e.id}).$promise.then(function(b){a.answer=b})["catch"](function(a){c.error(a)})},a.updateAnswer=function(){var b=angular.copy(a.answer);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.answers.view",{url:"/view/:id",templateUrl:"app/tools/answer/view/view.html",controller:"AnswerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.answers.view.settings",{url:"/settings",templateUrl:"app/tools/answer/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Automation",["$resource",function(a){return a("/api/automations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations",{url:"/automations",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("AutomationListCtrl",["$scope","$http","$translate","xAlert","Automation","gridOptions",function(a,b,c,d,e,f){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Automations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/automations/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.updateItem=function(a){return e.update({id:a.id},a).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.list",{url:"/list",templateUrl:"app/tools/automation/list/list.html",controller:"AutomationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("AutomationViewCtrl",["$scope","$stateParams","$http","$translate","xAlert","automations","Automation","$location",function(a,b,c,d,e,f,g,h){a.$automations=f,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.automation[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.automation[b].splice(c,1)},a.addAction=function(){a.automation.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.automation.Actions.splice(b,1)},a.initView=function(){return g.get({id:b.id}).$promise.then(function(b){a.automation=b})["catch"](function(a){e.error(a),h.path("/tools/automations/list")})},a.updateAutomation=function(){return g.update({id:b.id},a.automation).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.error(a)})},a.exitValidation=function(b){return console.log(b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length),b&&(a.automation.All.length||a.automation.Any.length)&&a.automation.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.view",{url:"/view/:id",templateUrl:"app/tools/automation/view/view.html",controller:"AutomationViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.automations.view.settings",{url:"/settings",templateUrl:"app/tools/automation/view/view.settings.html"}).state("main.tools.automations.view.routes",{url:"/routes",templateUrl:"app/tools/automation/view/view.routes.html"}).state("main.tools.automations.view.application",{url:"/application",templateUrl:"app/tools/automation/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("AutomationWizardCtrl",["$scope","$http","$location","xAlert","automations","WizardHandler","Automation",function(a,b,c,d,e,f,g){a.$automations=e,a.statusSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="mail",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/automations/list")})["catch"](function(a){console.error(a),d.error(a)})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.automations.wizard",{url:"/wizard",templateUrl:"app/tools/automation/wizard/wizard.html",controller:"AutomationWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("Interval",["$resource",function(a){return a("/api/intervals/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals",{url:"/intervals",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("IntervalListCtrl",["$scope","$uibModal","Interval","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"intervals.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/intervals/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/interval/list/list.create.modal.html",controller:"IntervalListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("IntervalListCreateCtrl",["$scope","$translate","$uibModalInstance","Interval","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.list",{url:"/list",templateUrl:"app/tools/interval/list/list.html",controller:"IntervalListCtrl"})}]),angular.module("xCallyShuttleApp").controller("IntervalViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","interval",function(a,b,c,d,e,f,g,h,i,j){function k(b){var c,d,e,f;c=b.t_from&&b.t_to&&!b.alwaysTime?moment(b.t_from).format("HH:mm")+"-"+moment(b.t_to).format("HH:mm"):"*",b.wd_from&&"always"!==b.wd_from?(d=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(d+="-"+b.wd_to)):d="*",b.md_from&&"always"!==b.md_from?(e=b.md_from,b.md_to&&"always"!==b.md_to&&(e+="-"+b.md_to)):e="*",b.m_from&&"always"!==b.m_from?(f=b.m_from,b.m_to&&"always"!==b.m_to&&(f+="-"+b.m_to)):f="*",void 0!==a.selectedSubInterval?a.interval.SubIntervals[a.selectedSubInterval].interval=c+","+d+","+e+","+f:a.subinterval.interval=c+","+d+","+e+","+f}a.$translate=d,a.$interval=j.interval,a.selectedSubInterval=void 0,a.gridOptions={columnDefs:[{name:"name",displayName:"APPLICATION_NAME",headerCellFilter:"translate"},{name:"interval",displayName:"APPLICATION_INTERVAL",headerCellFilter:"translate"},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,cellTemplate:'<a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openSubInterval(grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_SETTINGS\' | translate}}</a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteSubInterval(row.entity.name+\' interval\', grid.appScope.gridOptions.data.indexOf(row.entity))">{{\'APPLICATION_DELETE\' | translate}}</a>'}]},a.forms={subinterval:void 0,general:void 0},a.initSubInterval=function(b){b&&(a.selectedSubInterval=void 0),a.subinterval={},a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date),wd_from:"always",wd_to:"always",md_from:"always",md_to:"always",m_from:"always",m_to:"always",alwaysTime:!0}},a.next=function(){h.wizard().next()},a.previous=function(){h.wizard().previous()},a.exitValidation=function(a){return a},a.deselectAndRedirect=function(b){a.selectedSubInterval=void 0,g.path(b)},a.getInterval=function(){b.get("/api/intervals/"+e.id).success(function(b){a.interval=b,a.gridOptions.data=b.SubIntervals}).error(function(a){console.error(a),g.path("/tools/intervals/list")})},a.openSubInterval=function(b){a.selectedSubInterval=b,g.path("/tools/intervals/view/"+e.id+"/subintervals/settings")},a.updateInterval=function(f){a.selectedSubInterval=void 0,b.put("/api/intervals/"+e.id,a.interval).success(function(){a.getInterval(),c.show(d.instant("MESSAGE_WELL_DONE")+"!","success"),f&&g.path("/tools/intervals/view/"+e.id+"/"+f)}).error(function(a){c.error(a)})},a.getSubInterval=function(){void 0===a.selectedSubInterval&&g.path("/tools/intervals/list"),a.splittedInterval={t_from:moment(new Date),t_to:moment(new Date)};var b,c=a.interval.SubIntervals[a.selectedSubInterval]?a.interval.SubIntervals[a.selectedSubInterval].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.splittedInterval.t_from=moment(b[0],"HH:mm"),a.splittedInterval.t_to=moment(b[1],"HH:mm"),a.splittedInterval.alwaysTime=!1):(a.splittedInterval.t_from=moment(new Date),a.splittedInterval.t_to=moment(new Date),a.splittedInterval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.splittedInterval.wd_from=b[0],a.splittedInterval.wd_to=b[1]?b[1]:"always"):(a.splittedInterval.wd_from="always",a.splittedInterval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.splittedInterval.md_from=b[0],a.splittedInterval.md_to=b[1]?b[1]:"always"):(a.splittedInterval.md_from="always",a.splittedInterval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.splittedInterval.m_from=b[0],a.splittedInterval.m_to=b[1]?b[1]:"always"):(a.splittedInterval.m_from="always",a.splittedInterval.m_to="always")}})},a.$watch("splittedInterval",function(a){a&&k(a)},!0),a.addSubInterval=function(){a.interval.SubIntervals.push(a.subinterval),a.updateInterval("subintervals")},a.deleteSubInterval=i.confirm["delete"](function(b){a.interval.SubIntervals.splice(b,1),a.updateInterval()})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.intervals.view",{url:"/view/:id",templateUrl:"app/tools/interval/view/view.html",controller:"IntervalViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.intervals.view.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.settings.html"}).state("main.tools.intervals.view.subintervals",{url:"/subintervals",templateUrl:"app/tools/interval/view/view.subintervals.html"}).state("main.tools.intervals.view.subinterval",{url:"/subinterval",templateUrl:"app/tools/interval/view/view.subinterval.html"}).state("main.tools.intervals.view.subintervals.settings",{url:"/settings",templateUrl:"app/tools/interval/view/view.subintervalSettings.html"})}]),angular.module("xCallyShuttleApp").controller("PauseListCtrl",["$scope","$log","$uibModal","$translate","Pause","gridOptions",function(a,b,c,d,e,f){a.initView=function(){
 var b={exporterCsvFilename:"pauses.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/pauses/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=f.gridOptions(e,b,a)},a.createItem=function(){var b=c.open({animation:!0,templateUrl:"app/tools/pause/list/list.create.modal.html",controller:"PauseListCreateCtrl"});b.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("PauseListCreateCtrl",["$scope","$translate","$uibModalInstance","Pause","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.list",{url:"/list",templateUrl:"app/tools/pause/list/list.html",controller:"PauseListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Pause",["$resource",function(a){return a("/api/pauses/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses",{url:"/pauses",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("PauseViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Pause",function(a,b,c,d,e,f,g){a.getPause=function(){return g.get({id:e.id}).$promise.then(function(b){a.pause=b})["catch"](function(a){c.error(a)})},a.updatePause=function(){var b=angular.copy(a.pause);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.pauses.view",{url:"/view/:id",templateUrl:"app/tools/pause/view/view.html",controller:"PauseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.pauses.view.settings",{url:"/settings",templateUrl:"app/tools/pause/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SchedulerListCtrl",["$scope","Scheduler","gridOptions","xAlert","$translate","socket",function(a,b,c,d,e,f){a._=_,a.switches={isActive:!0,size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.scheduleTypes=[{name:"APPLICATION_REPORT_EXTRACTION",value:"report"},{name:"APPLICATION_HISTORY_MOVE",value:"history"},{name:"APPLICATION_DB_BACKUP",value:"backup"}],a.initView=function(){var d={exporterCsvFilename:"Schedules.csv",columnDefs:[{name:"name"},{name:"type",cellTemplate:'<div class="centered-uigrid-td">{{grid.appScope._.find(grid.appScope.scheduleTypes,{value:row.entity.type}).name | translate}}</div>'},{name:"description"},{name:"active",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.active" type="checkbox" switch-active="{{ grid.appScope.switches.isActive }}" switch-on-text="{{ \'APPLICATION_YES\' | translate }}" switch-off-text="{{ \'APPLICATION_NO\' | translate }}" switch-on-color="{{ grid.appScope.switches.onColor }}" switch-off-color="{{ grid.appScope.switches.offColor }}" switch-animate="{{ grid.appScope.switches.animate }}" switch-size="{{ grid.appScope.switches.size }}" switch-label="{{ grid.appScope.switches.label }}" switch-icon="{{ grid.appScope.switches.icon }}" switch-radio-off="{{ grid.appScope.switches.radioOff }}" switch-label-width="{{ grid.appScope.switches.labelWidth }}" switch-handle-width="{{ grid.appScope.switches.handleWidth }}"></div>',enableFiltering:!1,enableSorting:!1},{name:"sendMail",displayName:"APPLICATION_SEND_MAIL",cellTemplate:'<div data-ng-if="row.entity.type == \'report\'" class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.sendMail" type="checkbox" switch-active="{{ grid.appScope.switches.isActive }}" switch-on-text="{{ \'APPLICATION_YES\' | translate }}" switch-off-text="{{ \'APPLICATION_NO\' | translate }}" switch-on-color="{{ grid.appScope.switches.onColor }}" switch-off-color="{{ grid.appScope.switches.offColor }}" switch-animate="{{ grid.appScope.switches.animate }}" switch-size="{{ grid.appScope.switches.size }}" switch-label="{{ grid.appScope.switches.label }}" switch-icon="{{ grid.appScope.switches.icon }}" switch-radio-off="{{ grid.appScope.switches.radioOff }}" switch-label-width="{{ grid.appScope.switches.labelWidth }}" switch-handle-width="{{ grid.appScope.switches.handleWidth }}"></div>',enableFiltering:!1,enableSorting:!1},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/tools/scheduler/view/{{row.entity.id}}/settings",name:"settings"},{"class":"green-turquoise",name:"run",onClick:"grid.appScope.runSchedule(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.updateItem=function(a){return b.update({id:a.id},a).$promise.then(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.error(a)})},a.runSchedule=function(a){return b.get({id:a,controller:"run"}).$promise.then(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.scheduler.list",{url:"/list",templateUrl:"app/tools/scheduler/list/list.html",controller:"SchedulerListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Scheduler",["$resource",function(a){return a("/api/scheduler/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.scheduler",{url:"/scheduler",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("SchedulerViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","ReportTree","Scheduler","DefaultReport","CustomReport","$timeout","MailServerOut",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(){switch(a.schedule.cronType=a.rangeExec.type,a.rangeExec.type){case"daily":a.schedule.cron="00 "+a.rangeExec.hour+" * * *";break;case"weekly":a.schedule.cron="00 "+a.rangeExec.hour+" * * "+a.rangeExec.weekDays.join(",");break;case"monthly":a.schedule.cron="00 "+a.rangeExec.hour+" "+a.rangeExec.monthDay+" * *"}}function n(b){var c;switch(b.cronType){case"daily":a.rangeExec.hour=Number(b.cron.split(" ")[1]),a.rangeExec.type=b.cronType;break;case"weekly":c=b.cron.split(" "),a.rangeExec.hour=Number(c[1]),c[4].split(",").forEach(function(b){a.rangeExec.weekDays.push(Number(b))}),a.rangeExec.type=b.cronType;break;case"monthly":c=b.cron.split(" "),a.rangeExec.hour=Number(c[1]),a.rangeExec.monthDay=Number(c[2]),a.rangeExec.type=b.cronType;break;case"currentDay":a.switchValues.today=!0}a.$watch("rangeExec",function(b){a.switchValues.today||m()},!0)}a.forms={},a.rangeExec={weekDays:[],monthDay:null,hour:0,type:null},a.initReports=function(){var c;return a.reports=[],a.tempTodayCron=null,g.query().$promise.then(function(b){return a.defaultTreeData=JSON.parse(b[0].tree),a.customTreeData=JSON.parse(b[1].tree),i.get().$promise}).then(function(b){return a.defRep=b.rows,a.defRep.length&&_.forEach(a.defRep,function(b){c=_.find(a.defaultTreeData,{id:b.parent}),c&&(b.parent="Motion Reports - "+c.text,b.type="default")}),j.get().$promise}).then(function(b){return a.cusRep=b.rows,a.cusRep.length&&_.forEach(a.cusRep,function(b){c=_.find(a.customTreeData,{id:b.parent}),c&&(b.parent="Custom Reports - "+c.text,b.type="custom")}),l.get().$promise}).then(function(b){a.mailServers=b.rows;var c=_.find(a.mailServers,{MailAccountId:null});c&&(c.username+=" (custom)")})["catch"](function(a){b.error(a)})},a.initView=function(){return h.get({id:d.id}).$promise.then(function(b){a.schedule=b,n(b)}).then(function(){e.socket.on("schedule:update",function(b){a.schedule.id===b.id&&(a.schedule.active=b.active,a.schedule.sendMail=b.sendMail)})})["catch"](function(a){console.error(a),f.path("/tools/scheduler/list")})},a.refreshSlider=function(){k(function(){a.$broadcast("rzSliderForceRender"),a.refreshSlider=null})},a.monthDays=function(){for(var a=[],b=1;31>=b;b++)a.push(b);return a}(),a.hours=function(){for(var a=[],b=0;23>=b;b++)a.push(b);return a}(),a.setReportTree=function(b){a.schedule.reportType=b.type},a.validitySlider={ceil:24,floor:0,showTicks:!0},a.switchValues={today:!1},a.switches={isActive:!0,size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.scheduleTypes=[{name:"APPLICATION_REPORT_EXTRACTION",value:"report"}],a.todayCron=[{name:"15 min",value:"*/15 * * * *"},{name:"30 min",value:"*/30 * * * *"},{name:"1 h",value:"0 * * * *"}],a.reportRanges=[{name:"APPLICATION_PREVIOUS_DAY",value:"yesterday"},{name:"APPLICATION_LAST_SEVEN_DAYS",value:"last7"},{name:"APPLICATION_LAST_THIRTY_DAYS",value:"last30"},{name:"APPLICATION_LAST_MONTH",value:"lastMonth"}],a.cronTypes=[{name:"APPLICATION_DAY",value:"daily"},{name:"APPLICATION_WEEK",value:"weekly"},{name:"APPLICATION_MONTH",value:"monthly"}],a.weekDays=[{name:"APPLICATION_MONDAY",value:1},{name:"APPLICATION_TUESDAY",value:2},{name:"APPLICATION_WEDNESDAY",value:3},{name:"APPLICATION_THURSDAY",value:4},{name:"APPLICATION_FRIDAY",value:5},{name:"APPLICATION_SATURDAY",value:6},{name:"APPLICATION_SUNDAY",value:0}],a.checkToday=function(){a.switchValues.today?(a.schedule.cron=angular.copy(a.tempTodayCron),a.schedule.cronType="currentDay"):(a.tempTodayCron=angular.copy(a.schedule.cron),a.schedule.cron=void 0,m())},a.updateSchedule=function(){return h.update({id:a.schedule.id},a.schedule).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.scheduler.view",{url:"/view/:id",templateUrl:"app/tools/scheduler/view/view.html",controller:"SchedulerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.scheduler.view.settings",{url:"/settings",templateUrl:"app/tools/scheduler/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SchedulerWizardCtrl",["$scope","WizardHandler","$location","xAlert","Scheduler","ReportTree","$translate","DefaultReport","CustomReport","MailServerOut",function(a,b,c,d,e,f,g,h,i,j){function k(){switch(a.item.cronType=a.rangeExec.type,a.rangeExec.type){case"daily":a.item.cron="00 "+a.rangeExec.hour+" * * *";break;case"weekly":a.item.cron="00 "+a.rangeExec.hour+" * * "+a.rangeExec.weekDays.join(",");break;case"monthly":a.item.cron="00 "+a.rangeExec.hour+" "+a.rangeExec.monthDay+" * *"}}a.forms={},a.item={validityStart:8,validityEnd:16,type:"report",reportType:"default"},a.initReports=function(){a.reports=[];var b;return f.query().$promise.then(function(b){return a.defaultTreeData=JSON.parse(b[0].tree),a.customTreeData=JSON.parse(b[1].tree),h.get().$promise}).then(function(c){return a.defRep=c.rows,a.defRep.length&&_.forEach(a.defRep,function(c){b=_.find(a.defaultTreeData,{id:c.parent}),b&&(c.parent="Motion Reports - "+b.text,c.type="default")}),i.get().$promise}).then(function(c){return a.cusRep=c.rows,a.cusRep.length&&_.forEach(a.cusRep,function(c){b=_.find(a.customTreeData,{id:c.parent}),b&&(c.parent="Custom Reports - "+b.text,c.type="custom")}),j.get().$promise}).then(function(b){a.mailServers=b.rows;var c=_.find(a.mailServers,{MailAccountId:null});c&&(c.username+=" (custom)")})["catch"](function(a){d.error(a)})},a.setReportTree=function(b){a.item.reportType=b.type},a.validitySlider={ceil:24,floor:0,showTicks:!0},a.switchValues={today:!1},a.switches={isActive:!0,size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.scheduleTypes=[{name:"APPLICATION_REPORT_EXTRACTION",value:"report"}],a.todayCron=[{name:"15 min",value:"*/15 * * * *"},{name:"30 min",value:"*/30 * * * *"},{name:"1 h",value:"0 * * * *"}],a.reportRanges=[{name:"APPLICATION_PREVIOUS_DAY",value:"yesterday"},{name:"APPLICATION_LAST_SEVEN_DAYS",value:"last7"},{name:"APPLICATION_LAST_THIRTY_DAYS",value:"last30"},{name:"APPLICATION_LAST_MONTH",value:"lastMonth"}],a.cronTypes=[{name:"APPLICATION_DAY",value:"daily"},{name:"APPLICATION_WEEK",value:"weekly"},{name:"APPLICATION_MONTH",value:"monthly"}],a.weekDays=[{name:"APPLICATION_MONDAY",value:1},{name:"APPLICATION_TUESDAY",value:2},{name:"APPLICATION_WEDNESDAY",value:3},{name:"APPLICATION_THURSDAY",value:4},{name:"APPLICATION_FRIDAY",value:5},{name:"APPLICATION_SATURDAY",value:6},{name:"APPLICATION_SUNDAY",value:0}],a.tempTodayCron=null,a.checkToday=function(){a.switchValues.today?(a.item.cron=angular.copy(a.tempTodayCron),a.item.cronType="currentDay"):(a.tempTodayCron=angular.copy(a.item.cron),a.item.cron=void 0,k())},a.monthDays=function(){for(var a=[],b=1;31>=b;b++)a.push(b);return a}(),a.hours=function(){for(var a=[],b=0;23>=b;b++)a.push(b);return a}(),a.rangeExec={weekDays:[],monthDay:null,hour:0,type:null},a.$watch("rangeExec",function(b){a.switchValues.today||k()},!0),a.next=function(){b.wizard().next()},a.previous=function(){b.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){return e.save(a.item).$promise.then(function(){c.path("/tools/scheduler/list")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.scheduler.wizard",{url:"/wizard",templateUrl:"app/tools/scheduler/wizard/wizard.html",controller:"SchedulerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("SoundListCtrl",["$scope","$http","socket","Modal","$q","FileUploader","$translate","xAlert","$cookieStore","$sce","Sound",function(a,b,c,d,e,f,g,h,i,j,k){a.Sound=k,a.isCollapsed=!0,a.downloadButtonClass="btn btn-xs blue-hoki",a["delete"]=d.confirm["delete"](function(a){b["delete"]("/api/sounds/"+a).success(function(a){}).error(function(a){console.log(a)})}),a.updateAudio=function(a,c){var d=e.defer();return b.put("/api/sounds/"+a,c).success(function(a){d.resolve()}).error(function(a){console.log(a.message),d.reject(a.message)}),d.promise},a.$on("$destroy",function(){c.unsyncUpdates("sound")}),a.initList=function(){b.get("/api/sounds").success(function(b){a.sounds=b.rows,b.rows.length||(a.isCollapsed=!1),c.syncUpdates("sound",a.sounds,function(){a.sounds.length||(a.isCollapsed=!1)})})};var l=a.uploader=new f({url:"/api/sounds",withCredentials:!0,headers:{Authorization:"Bearer "+i.get("token")}});l.filters.push({name:"customFilter",fn:function(a,b){return this.queue.length<10}}),l.onWhenAddingFileFailed=function(a,b,c){console.info("onWhenAddingFileFailed",a,b,c)},l.onAfterAddingFile=function(a){console.info("onAfterAddingFile",a)},l.onAfterAddingAll=function(a){console.info("onAfterAddingAll",a)},l.onBeforeUploadItem=function(a){console.info("onBeforeUploadItem",a)},l.onProgressItem=function(a,b){console.info("onProgressItem",a,b),a.isUploading=!0},l.onProgressAll=function(a){console.info("onProgressAll",a)},l.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),a.isUploading=!1},l.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),a.responseMessage=b,a.isUploading=!1},l.onCancelItem=function(a,b,c,d){console.info("onCancelItem",a,b,c,d),a.isUploading=!1},l.onCompleteItem=function(a,b,c,d){console.info("onCompleteItem",a,b,c,d),a.isUploading=!1},l.onCompleteAll=function(){console.info("onCompleteAll")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds.list",{url:"/list",templateUrl:"app/tools/sound/list/list.html",controller:"SoundListCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js"]})}]}})}]),angular.module("xCallyShuttleApp").factory("Sound",["$resource",function(a){return a("/api/sounds/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.sounds",{url:"/sounds",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("TagListCtrl",["$scope","$uibModal","Tag","gridOptions","$rootScope",function(a,b,c,d,e){a.initView=function(){var b={exporterCsvFilename:"tag.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/tags/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/tag/list/list.create.modal.html",controller:"TagListCreateCtrl"});c.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("TagListCreateCtrl",["$scope","$translate","$uibModalInstance","Tag","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.list",{url:"/list",templateUrl:"app/tools/tag/list/list.html",controller:"TagListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Tag",["$resource",function(a){return a("/api/tags/:id/:controller/:tag",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags",{url:"/tags",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("TagViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location","Tag","gridOptions","List","Company","Contact","uiGridConstants","usSpinnerService",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){m.stop("spinner-grid"),a.readyGrid=!0}a.getTag=function(){return g.get({id:e.id}).$promise.then(function(b){a.tag=b})["catch"](function(a){c.error(a)})},a.updateTag=function(){var b=angular.copy(a.tag);return g.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})},a.initChat=function(){m.spin("spinner-grid");var b={enableRowSelection:!1,exporterCsvFilename:"tagChat.csv",columnDefs:[{name:"type"},{name:"status"},{name:"ChatWebsite.name",displayName:"APPLICATION_WEBSITE"},{name:"ChatVisitor.email",displayName:"APPLICATION_VISITOR"},{name:"action",width:40,buttons:[{"class":"green",name:"chatRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'chatRoom')"}]}]};a.gridOptions=h.gridOptions(g,b,a,{controller:"chat",tag:a.tag.name},null,null,n())},a.initMail=function(){m.spin("spinner-grid");var b={enableRowSelection:!1,exporterCsvFilename:"tagMail.csv",columnDefs:[{name:"subject"},{name:"from"},{name:"account"},{name:"status"},{name:"action",width:40,buttons:[{"class":"green",name:"mailRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'mailRoom')"}]}]};a.gridOptions=h.gridOptions(g,b,a,{controller:"mail",tag:a.tag.name},null,null,n())},a.initFax=function(){m.spin("spinner-grid");var b={enableRowSelection:!1,exporterCsvFilename:"tagFax.csv",columnDefs:[{name:"from"},{name:"account"},{name:"status"},{name:"action",width:40,buttons:[{"class":"green",name:"faxRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'faxRoom')"}]}]};a.gridOptions=h.gridOptions(g,b,a,{controller:"fax",tag:a.tag.name},null,null,n())},a.initSms=function(){m.spin("spinner-grid");var b={enableRowSelection:!1,exporterCsvFilename:"tagSms.csv",columnDefs:[{name:"from"},{name:"status"},{name:"action",width:40,buttons:[{"class":"green",name:"smsRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'smsRoom')"}]}]};a.gridOptions=h.gridOptions(g,b,a,{controller:"sms",tag:a.tag.name},null,null,n())},a.initContacts=function(){a.readyGrid=!1,m.spin("spinner-grid");var b;return i.get().$promise.then(function(b){return a.lists=[],b.rows.forEach(function(b,c){a.lists.push({value:b.id,label:b.name})}),j.get().$promise}).then(function(b){a.companies=[],b.rows.forEach(function(b,c){a.companies.push({value:b.id,label:b.name})})}).then(function(){b={enableRowSelection:!1,exporterCsvFilename:"tagContacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"email"},{name:"ListId",displayName:"APPLICATION_LIST",field:"List.name",filter:{type:l.filter.SELECT,selectOptions:a.lists}},{name:"CompanyId",displayName:"APPLICATION_COMPANY",field:"Company.name",filter:{type:l.filter.SELECT,term:e.companyId||null,selectOptions:a.companies}},{name:"action",width:40,buttons:[{"class":"blue-hoki",name:"profile",onClick:"grid.appScope.openContactTab(row.entity)"}]}]},a.gridOptions=h.gridOptions(g,b,a,{controller:"contacts",tag:a.tag.name},null,null,n())})["catch"](function(a){c.error(a)})},a.openRoom=function(b,c){var d=_.find(a.workspaces,{id:b,type:c});if(d)d.active=!0;else{var e;switch(c){case"mailRoom":e="icon-envelope";break;case"chatRoom":e="fa fa-users";break;case"faxRoom":e="icon-paper-plane";break;case"smsRoom":e="glyphicon glyphicon-comment"}a.workspaces.push({id:b,type:c,"class":e,active:!0})}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.tags.view",{url:"/view/:id",templateUrl:"app/tools/tag/view/view.html",controller:"TagViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.tags.view.settings",{url:"/settings",templateUrl:"app/tools/tag/view/view.settings.html"}).state("main.tools.tags.view.chat",{url:"/chat",templateUrl:"app/tools/tag/view/view.chat.html"}).state("main.tools.tags.view.mail",{url:"/mail",templateUrl:"app/tools/tag/view/view.mail.html"}).state("main.tools.tags.view.fax",{url:"/fax",templateUrl:"app/tools/tag/view/view.fax.html"}).state("main.tools.tags.view.sms",{url:"/sms",templateUrl:"app/tools/tag/view/view.sms.html"}).state("main.tools.tags.view.contacts",{url:"/contacts",templateUrl:"app/tools/tag/view/view.contacts.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateListCtrl",["$scope","Template","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"templates.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/templates/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.list",{url:"/list",templateUrl:"app/tools/template/list/list.html",controller:"TemplateListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Template",["$resource",function(a){return a("/api/templates/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates",{url:"/templates",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("TemplateViewCtrl",["$scope","$rootScope","$http","$translate","$stateParams","xAlert","Template","templateVariable","Variable",function(a,b,c,d,e,f,g,h,i){a.initItem=function(){CKEDITOR.plugins.addExternal("richparams","/assets/plugins/ckeditor-richparams/"),a.options={language:b.language,allowedContent:!0,entities:!1,skin:"office2013",contentsCss:"/assets/css/global/richparams.css",extraPlugins:"richparams,autogrow",autoGrow_minHeight:450,richparams:h,disableNativeSpellChecker:!1,toolbar:[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"insert",items:["Image","Table","HorizontalRule","SpecialChar"]},{name:"tools",items:["Maximize"]},{name:"document",items:["Source"]},"/",{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote"]},{name:"styles",items:["Styles","Format"]},"/",{name:"motion",items:["voice","chat","mail"]}]},a.form={},a.item={},a.item=g.get({id:e.id})},a.updateItem=function(){return g.update(a.item).$promise.then(function(){f.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.view",{url:"/view/:id",templateUrl:"app/tools/template/view/view.html",controller:"TemplateViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.templates.view.settings",{url:"/settings",templateUrl:"app/tools/template/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TemplateWizardCtrl",["$scope","$rootScope","$location","$http","WizardHandler","xAlert","Template","templateVariable",function(a,b,c,d,e,f,g,h){a.initWizard=function(){CKEDITOR.plugins.addExternal("richparams","/assets/plugins/ckeditor-richparams/"),a.options={language:b.language,allowedContent:!0,entities:!1,skin:"office2013",contentsCss:"/assets/css/global/richparams.css",extraPlugins:"richparams,autogrow",autoGrow_minHeight:450,disableNativeSpellChecker:!1,richparams:h,toolbar:[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"insert",items:["Image","Table","HorizontalRule","SpecialChar"]},{name:"tools",items:["Maximize"]},{name:"document",items:["Source"]},"/",{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote"]},{name:"styles",items:["Styles","Format"]},"/",{name:"motion",items:["voice","chat","mail"]}]},a.item={},a.form={}},a.exitValidation=function(a){return a},a.createItem=function(){return g.save({name:a.item.name,description:a.item.description,subject:a.item.subject||null,html:a.item.html||null,text:a.item.text||null}).$promise.then(function(){c.path("/tools/templates/list")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.templates.wizard",{url:"/wizard",templateUrl:"app/tools/template/wizard/wizard.html",controller:"TemplateWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools",{url:"/tools",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TriggerListCtrl",["$scope","$http","$translate","Modal","xAlert","Trigger","gridOptions",function(a,b,c,d,e,f,g){a.onText="On",a.offText="Off",a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var b={exporterCsvFilename:"Triggers.csv",columnDefs:[{name:"name"},{name:"description"},{name:"channel"},{name:"status",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.status" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ grid.appScope.onText }}" switch-off-text="{{ grid.appScope.offText }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>',width:100,enableFiltering:!1},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/triggers/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=g.gridOptions(f,b,a)},a.updateItem=function(a){return f.update({id:a.id},a).$promise.then(function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.list",{url:"/list",templateUrl:"app/tools/trigger/list/list.html",controller:"TriggerListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trigger",["$resource",function(a){return a("/api/triggers/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers",{url:"/triggers",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("TriggerViewCtrl",["$scope","$stateParams","$http","$translate","xAlert","triggers","Trigger","$location",function(a,b,c,d,e,f,g,h){a.$triggers=f,a.recordSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.forms={general:{}},a.addCondition=function(b){a.trigger[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.trigger[b].splice(c,1)},a.addAction=function(){a.trigger.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.trigger.Actions.splice(b,1)},a.initView=function(){return g.get({id:b.id}).$promise.then(function(b){a.trigger=b})["catch"](function(a){e.error(a),h.path("/tools/triggers/list")})},a.updateTrigger=function(){return g.update({id:b.id},a.trigger).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),e.error(a)})},a.exitValidation=function(b){return b&&(a.trigger.All.length||a.trigger.Any.length)&&a.trigger.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.view",{url:"/view/:id",templateUrl:"app/tools/trigger/view/view.html",controller:"TriggerViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",
 files:["assets/css/profile.css","assets/css/tasks.css"]})}]}}).state("main.tools.triggers.view.settings",{url:"/settings",templateUrl:"app/tools/trigger/view/view.settings.html"}).state("main.tools.triggers.view.routes",{url:"/routes",templateUrl:"app/tools/trigger/view/view.routes.html"}).state("main.tools.triggers.view.application",{url:"/application",templateUrl:"app/tools/trigger/view/view.application.html"})}]),angular.module("xCallyShuttleApp").controller("TriggerWizardCtrl",["$scope","$http","$location","xAlert","triggers","WizardHandler","Trigger",function(a,b,c,d,e,f,g){a.$triggers=e,a.statusSwitch={onText:"On",offText:"Off",isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.tempData={voice:{},mail:{},chat:{},fax:{}},a.item={All:[],Any:[],Actions:[]},a.forms={general:void 0,settings:void 0},a.addCondition=function(b){a.item[b].push({field:"",operator:"",value:""})},a.removeCondition=function(b,c){a.item[b].splice(c,1)},a.addAction=function(){a.item.Actions.push({action:"",data1:"",data2:"",data3:"",data4:"",data5:""})},a.resetActionData=function(a){a.data1="",a.data2="",a.data3="",a.data4="",a.data5=""},a.removeAction=function(b){a.item.Actions.splice(b,1)},a.$watch("item.channel",function(b,c){c&&(a.tempData[c].All=_.clone(a.item.All,!0),a.tempData[c].Any=_.clone(a.item.Any,!0),a.tempData[c].Actions=_.clone(a.item.Actions,!0)),a.item.All=a.tempData[b].All?a.tempData[b].All:[],a.item.Any=a.tempData[b].Any?a.tempData[b].Any:[],a.item.Actions=a.tempData[b].Actions?a.tempData[b].Actions:[]},!0),a.item.channel="voice",a.createItem=function(){return g.save(a.item).$promise.then(function(){c.path("/tools/triggers/list")})["catch"](function(a){console.error(a),d.error(a)})},a.next=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.exitValidation=function(a){return a},a.exitSettingsValidation=function(b){return b&&(a.item.All.length||a.item.Any.length)&&a.item.Actions.length?!0:!1}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.triggers.wizard",{url:"/wizard",templateUrl:"app/tools/trigger/wizard/wizard.html",controller:"TriggerWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("TrunkListCtrl",["$scope","Trunk","gridOptions","xAlert","$translate","socket",function(a,b,c,d,e,f){function g(){f.socket.on("trunk:update",function(b){var c=_.find(a.gridOptions.data,{name:b.name});c&&(c.status=b.status,c.peerstatus=b.peerstatus)})}a.isActive=!0,a.size="mini",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.initView=function(){var d={exporterCsvFilename:"Trunks.csv",columnDefs:[{name:"name"},{name:"active",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.active" type="checkbox" switch-active="{{ grid.appScope.isActive }}" switch-on-text="{{ \'APPLICATION_YES\' | translate }}" switch-off-text="{{ \'APPLICATION_NO\' | translate }}" switch-on-color="{{ grid.appScope.onColor }}" switch-off-color="{{ grid.appScope.offColor }}" switch-animate="{{ grid.appScope.animate }}" switch-size="{{ grid.appScope.size }}" switch-label="{{ grid.appScope.label }}" switch-icon="{{ grid.appScope.icon }}" switch-radio-off="{{ grid.appScope.radioOff }}" switch-label-width="{{ grid.appScope.labelWidth }}" switch-handle-width="{{ grid.appScope.handleWidth }}"></div>'},{name:"host"},{name:"description"},{name:"status",cellTemplate:'<div class="centered-uigrid-td" data-ng-if="row.entity.active && row.entity.registry && row.entity.status">{{row.entity.status}}</div>'},{name:"peerstatus",cellTemplate:'<div class="centered-uigrid-td" data-ng-if="row.entity.active && row.entity.peerstatus">{{row.entity.peerstatus}}</div>'},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/trunks/view/{{row.entity.name}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.name)"}]}]};a.gridOptions=c.gridOptions(b,d,a,null,null,null,g)},a.updateItem=function(a){return b.update({id:a.name},a).$promise.then(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){console.error(a),d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.list",{url:"/list",templateUrl:"app/tools/trunk/list/list.html",controller:"TrunkListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Trunk",["$resource",function(a){return a("/api/trunks/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks",{url:"/trunks",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("TrunkViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","socket","$location","Trunk","VoiceContext",function(a,b,c,d,e,f,g,h,i){a.activeSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.initView=function(){return h.get({id:e.id}).$promise.then(function(b){b.nat=b.nat?b.nat.split(","):[],b.allow=b.allow?b.allow.split(";"):[],b.insecure=b.insecure?b.insecure.split(","):[],b.transport=b.transport?b.transport.split(","):[],a.trunk=b}).then(function(){f.socket.on("trunk:update",function(b){a.trunk.name===b.name&&(a.trunk.status=b.status)})})["catch"](function(a){console.error(a),g.path("/tools/trunks/list")})},a.updateTrunk=function(){""===a.trunk.password&&delete a.trunk.password;var b=angular.copy(a.trunk);return b.nat=b.nat.join(","),b.allow=b.allow.join(";"),b.insecure=b.insecure.join(","),b.transport=b.transport.join(","),h.update({id:e.id},b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){c.error(a)})},a.getContexts=function(){return i.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){c.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.view",{url:"/view/:id",templateUrl:"app/tools/trunk/view/view.html",controller:"TrunkViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.trunks.view.settings",{url:"/settings",templateUrl:"app/tools/trunk/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TrunkWizardCtrl",["$scope","WizardHandler","$location","xAlert","Trunk",function(a,b,c,d,e){a.initWizard=function(){a.forms={},a.item={context:"from-voip-provider"}},a.next=function(){b.wizard().next()},a.previous=function(){b.wizard().previous()},a.exitValidation=function(a){return a},a.createItem=function(){return a.item.fromuser=a.item.defaultuser,a.item.fromdomain=a.item.host,e.save(a.item).$promise.then(function(){c.path("/tools/trunks/list")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.trunks.wizard",{url:"/wizard",templateUrl:"app/tools/trunk/wizard/wizard.html",controller:"TrunkWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("VariableListCtrl",["$scope","$uibModal","Variable","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"variables.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/tools/variables/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/tools/variable/list/list.create.modal.html",controller:"VariableListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("VariableListCreateCtrl",["$scope","$translate","$uibModalInstance","Variable","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.save(a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.list",{url:"/list",templateUrl:"app/tools/variable/list/list.html",controller:"VariableListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Variable",["$resource",function(a){return a("/api/variables/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables",{url:"/variables",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:13}}})}]),angular.module("xCallyShuttleApp").controller("VariableViewCtrl",["$scope","$translate","$stateParams","xAlert","Variable",function(a,b,c,d,e){a.getVariable=function(){return e.get({id:c.id}).$promise.then(function(b){a.variable=b})["catch"](function(a){d.error(a)})},a.updateVariable=function(){return e.update({id:c.id},a.variable).$promise.then(function(){d.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.variables.view",{url:"/view/:id",templateUrl:"app/tools/variable/view/view.html",controller:"VariableViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.variables.view.settings",{url:"/settings",templateUrl:"app/tools/variable/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCloneModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCreateModalCtrl",["$scope","$uibModalInstance",function(a,b){a.forms={dashboard:void 0},a.item={},a.ok=function(){a.item.model=JSON.stringify({title:a.item.name}),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardListCtrl",["$scope","$http","$translate","xAlert","Modal","$uibModal","$log","YourDashboard","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"voice_contexts.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"green",href:"/tools/yourdashboards/show/{{row.entity.id}}",name:"view"},{"class":"blue-hoki",href:"/tools/yourdashboards/view/{{row.entity.id}}/settings",name:"settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"purple",name:"clone",onClick:"grid.appScope.clone(row.entity.id)"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var b=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/create.modal.html",controller:"YourdashboardListCreateModalCtrl"});b.result.then(function(b){return h.save(b).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.error(a)})},function(){g.info("Modal dismissed at: "+new Date)})},a.clone=function(b){var e=f.open({animation:!0,templateUrl:"app/tools/yourdashboard/list/clone.modal.html",controller:"YourdashboardListCloneModalCtrl"});e.result.then(function(e){return h.save({id:b,controller:"clone"},e).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE"),"success"),a.gridOptions.getPage()})["catch"](function(a){console.error(a),d.error(a)})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.list",{url:"/list",templateUrl:"app/tools/yourdashboard/list/list.html",controller:"YourdashboardListCtrl"})}]),angular.module("xCallyShuttleApp").controller("LeaveEditedDashboardModalCtrl",["$scope","$uibModalInstance",function(a,b){a.close=function(){b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("YourdashboardShowCtrl",["$scope","$rootScope","localStorageService","xAlert","$translate","Auth","$stateParams","$location","$uibModal","$log","YourDashboard",function(a,b,c,d,e,f,g,h,i,j,k){a.Auth=f,a.editMode=!1,a.getDashboard=function(){return k.get({id:g.id}).$promise.then(function(b){var c={name:"dashboard",structure:"4-8",enableconfirmdelete:!0,maximizable:!0,collapsible:!0};b.model=JSON.parse(b.model||'{"title":"Dashboard"}'),b.editable=f.isAdmin()&&b.editable?!0:!1,a.dashboard=_.merge(c,b)})["catch"](function(a){h.path("/tools/yourdashboards/list")})},a.$on("$locationChangeStart",function(b,c,d){if(a.editMode){b.preventDefault();var e=i.open({animation:!0,templateUrl:"app/tools/yourdashboard/show/leaveEditedDashboard.modal.html",controller:"LeaveEditedDashboardModalCtrl"});e.result.then(function(b){a.editMode=!1;var d=location.protocol+"//"+location.host;h.path(c.replace(d,""))},function(){j.info("Modal dismissed at: "+new Date)})}});var l=function(b,c,f){var h=angular.copy(a.dashboard);return h.name=a.dashboard.model.title,h.model=JSON.stringify(h.model),k.update({id:g.id},h).$promise.then(function(){d.show(e.instant("MESSAGE_DASHBOARD_SAVED")+"!","success"),a.editMode=!1})["catch"](function(b){d.error(b),h.model=JSON.parse(h.model),h.name="dashboard",a.dashboard=h})};a.$on("adfDashboardChanged",l),a.$on("adfIsEditMode",function(){a.editMode=!0}),a.$on("destroy",function(){console.log("main dashboard")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.show",{url:"/show/:id",templateUrl:"app/tools/yourdashboard/show/show.html",controller:"YourdashboardShowCtrl"})}]),angular.module("xCallyShuttleApp").controller("YourdashboardViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$location",function(a,b,c,d,e,f){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.getDashboard=function(){b.get("/api/dashboards/"+e.id).success(function(b){delete b.model,a.dashboard=b}).error(function(a){f.path("/tools/yourdashboards/list")})},a.updateDashboard=function(){var f=angular.copy(a.dashboard);b.put("/api/dashboards/"+e.id,f).success(function(){c.show(d.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(b){c.error(b),a.dashboard=f})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards.view",{url:"/view/:id",templateUrl:"app/tools/yourdashboard/view/view.html",controller:"YourdashboardViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.tools.yourdashboards.view.settings",{url:"/settings",templateUrl:"app/tools/yourdashboard/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("YourDashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.tools.yourdashboards",{url:"/yourdashboards",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:2}}})}]),angular.module("xCallyShuttleApp").controller("ZendeskListCtrl",["$scope","ZendeskAccount","gridOptions","xAlert","$translate",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"zendesk_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_URI"},{name:"action",buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-jungle",name:"check",onClick:"grid.appScope.checkAccount(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.checkAccount=function(a){return b.check({id:a}).$promise.then(function(){d.show(e.instant("MESSAGE_ACCOUNT_VERIFIED"),"success")})["catch"](function(){d.show(e.instant("MESSAGE_ACCOUNT_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.list",{url:"/list",templateUrl:"app/zendesk/list/list.html",controller:"ZendeskListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/smart_table.css"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations",{url:"/configurations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationListCtrl",["$scope","$stateParams","$translate","gridOptions","ZendeskConfiguration","$uibModal",function(a,b,c,d,e,f){a.initView=function(){var c={exporterCsvFilename:"zendesk_configurations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/zendesk/view/{{row.entity.AccountId}}/configurations/view/{{row.entity.id}}",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=d.gridOptions(e,c,a,{accountId:b.id})},a.createItem=function(){var b=f.open({animation:!0,templateUrl:"app/zendesk/view/configuration/list/create.modal.html",controller:"ZendeskCreateConfigurationCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ZendeskCreateConfigurationCtrl",["$scope","$translate","$uibModalInstance","ZendeskConfiguration","xAlert","$stateParams","channel",function(a,b,c,d,e,f,g){a.form={},a.item={},a.channels=g,a.item.channel="voice",a.item.type="Queue",a.save=function(){return d.save({accountId:f.id},a.item).$promise.then(function(a){e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.list",{url:"/list",templateUrl:"app/zendesk/view/configuration/list/list.html",controller:"ZendeskViewConfigurationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewConfigurationViewCtrl",["$scope","$stateParams","$filter","$translate","socket","ZendeskConfiguration","xAlert","variable","Variable","ZendeskAccount","Tag","ZendeskField",function(a,b,c,d,e,f,g,h,i,j,k,l){a.$on("$destroy",function(){e.unsyncUpdates("zendesk_field")}),a.config={autoHideScrollbar:!1,theme:"dark",advanced:{updateOnContentResize:!0},setHeight:300,scrollInertia:0},a.fieldType=[{type:"string",title:"String"},{type:"variable",title:"Variable"},{type:"customVariable",title:"Custom Variable"}],a.descFieldType=[{type:"string",title:"String"},{type:"keyValue",title:"Key Value"}],a.groupVariableByGroup=function(a){switch(a.group){case"voice_queue":return"Voice: Queue";case"voice_outbound":return"Voice: Outbound";default:return"Other"}},a.initView=function(){a.configurationName="",a.subjectConfig=[],a.descriptionConfig=[],a.fieldConfig=[],a.selectedTags={tags:[]},a.variables=h},a.getConfiguration=function(){return f.get({accountId:b.id,id:b.configurationId}).$promise.then(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,a.selectedTags={tags:_.map(b.Tags,function(a){return a.id})},e.socket.on("zendesk_field:remove",function(b){_.remove(a.subjectConfig,{id:b.id}),_.remove(a.descriptionConfig,{id:b.id}),_.remove(a.fieldConfig,{id:b.id})})})["catch"](function(a){g.error(a)})},a.getCustomVariables=function(){return i.get().$promise.then(function(b){a.customVariables=b.rows})["catch"](function(a){g.error(a)})},a.getFields=function(){return j.fields({id:b.id}).$promise.then(function(b){a.accountFields=c("zendesk")(b)})["catch"](function(a){g.error(a)})},a.getTags=function(){return k.get().$promise.then(function(b){a.tags=b.rows})["catch"](function(a){g.error(a)})},a.addItem=function(c){var d={};switch(c){case"subject":case"description":d={type:"string",content:""};break;case"field":d={content:""}}return f.save({accountId:b.id,id:b.configurationId,controller:c},d).$promise.then(function(b){switch(c){case"subject":a.subjectConfig.push(b);break;case"description":a.descriptionConfig.push(b);break;case"field":a.fieldConfig.push(b)}})["catch"](function(a){g.error(a)})},a.changeType=function(b){"variable"===b.type?(b.content="",b.variableName=""):"string"===b.type?(b.VariableId=null,b.variableName=""):"customVariable"===b.type&&(b.VariableId=null,b.content=""),a.updateField(b)},a.updateField=function(a){return l.update({accountId:b.id,configurationId:b.configurationId,id:a.id},a).$promise.then(function(){})["catch"](function(a){g.error(a)})},a.removeItem=function(a){return l["delete"]({accountId:b.id,configurationId:b.configurationId,id:a.id}).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){g.error(a)})},a.changeDescType=function(b){"keyValue"===b.type?(b.content="","string"===b.keyType?(b.VariableId=null,b.variableName=""):"variable"===b.keyType?(b.keyContent="",b.VariableId=null):"customVariable"===b.keyType&&(b.keyContent="",b.variableName="")):"string"===b.type&&(b.VariableId=null,b.variableName="",b.key="",b.keyContent=""),a.updateField(b)},a.changeFieldType=function(b){if(b.content="",b.variableName="",b.nameField="",b.VariableId=null,b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(c.system_field_options?(b.customField=!1,b.nameField=c.title.toLowerCase()):b.customField=!0)}a.updateField(b)},a.updateTags=function(){return f.update({accountId:b.id,id:b.configurationId,controller:"tags"},a.selectedTags.tags).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){g.error(a)})},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.system_field_options?c.system_field_options:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view.configurations.view",{url:"/view/:configurationId",templateUrl:"app/zendesk/view/configuration/view/view.html",controller:"ZendeskViewConfigurationViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("ZendeskViewCtrl",["$scope","$stateParams","$translate","xAlert","Modal","ZendeskAccount",function(a,b,c,d,e,f){a.initView=function(){return f.get({id:b.id}).$promise.then(function(b){a.account=b})["catch"](function(a){d.error(a)})},a.updateItem=function(){return f.update({id:b.id},a.account).$promise.then(function(){d.show(c.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.view",{url:"/view/:id",templateUrl:"app/zendesk/view/view.html",controller:"ZendeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.zendesk.view.account",{url:"/account",templateUrl:"app/zendesk/view/view.account.html"})}]),angular.module("xCallyShuttleApp").controller("ZendeskWizardCtrl",["$scope","$http","$location","$translate","xAlert","WizardHandler","ZendeskAccount",function(a,b,c,d,e,f,g){a.translate=d,a.initWizard=function(){a.$translate=d,a.forms={},a.item={},a.item.authType="password",a.item.serverUrl=c.protocol()+"://"+location.host},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){return g.save(a.item).$promise.then(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/zendesk/list")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk.wizard",{url:"/wizard",templateUrl:"app/zendesk/wizard/wizard.html",controller:"ZendeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("ZendeskAccount",["$resource",function(a){return a("/api/zendesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"},fields:{params:{controller:"fields"},isArray:!0},check:{params:{controller:"check"}}})}]).factory("ZendeskConfiguration",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]).factory("ZendeskField",["$resource",function(a){return a("/api/zendesk/accounts/:accountId/configurations/:configurationId/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.zendesk",{url:"/zendesk",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("Auth",["$location","$rootScope","$http","User","$cookieStore","$q",function(a,b,c,d,e,f){var g={};return e.get("token")&&(g=d.me()),{login:function(a,h){var i=h||angular.noop,j=f.defer();return c.post("/auth/local",{name:a.name,password:a.password,remember:a.remember}).success(function(a){return e.put("role",a.role),e.put("token",a.token),e.put("userId",a.userId),g=d.me({},function(){b.$broadcast("login")}),j.resolve(a),i()}).error(function(a){return this.logout(),j.reject(a),i(a)}.bind(this)),j.promise},recover:function(a,b){var d=b||angular.noop,e=f.defer();return c.post("/auth/local/recover",{email:a.email}).success(function(a){return e.resolve(a),d()}).error(function(a){return e.reject(a),d(a)}.bind(this)),e.promise},reset:function(a,b){var d=b||angular.noop,e=f.defer();return c.post("/auth/local/reset/"+a.token,{password:a.password}).success(function(a){return e.resolve(a),d()}).error(function(a){return e.reject(a),d(a)}.bind(this)),e.promise},loginWithToken:function(a,c,f){e.put("role",f),e.put("token",a),e.put("userId",c),g=d.me({},function(){b.$broadcast("login")})},logout:function(){c.put("/api/users/"+g.id,{online:!1}).success(function(){e.remove("role"),e.remove("token"),e.remove("userId"),g={},b.$broadcast("logout")}).error(function(a){return a})},createUser:function(a,b){var c=b||angular.noop;return d.save(a,function(b){return e.put("token",b.token),g=d.me(),c(a)},function(a){return this.logout(),c(a)}.bind(this)).$promise},changePassword:function(a,b,c){var e=c||angular.noop;return d.changePassword({id:g.id},{oldPassword:a,newPassword:b},function(a){return e(null,a)},function(a){return e(a)}).$promise},getCurrentUser:function(){return g},isLoggedIn:function(){return g.hasOwnProperty("role")},isLoggedInAsync:function(a){g.hasOwnProperty("$promise")?g.$promise.then(function(){a(!0)})["catch"](function(){a(!1)}):a(g.hasOwnProperty("role")?!0:!1)},isAdmin:function(){return"admin"===(e.get("role")||g.role)},isUser:function(){return"user"===(e.get("role")||g.role)},isAgent:function(){return"agent"===(e.get("role")||g.role)},getRole:function(){return g.role},getToken:function(){return e.get("token")}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderAccountEmail",["$compile","$timeout","MailAccount","xAlert",function(a,b,c,d){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/accountEmail/actionBuilder.html",compile:function(e){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var g,h;return g=e.contents().remove(),function(e,i){e.randomName=f(),b(function(){return c.get().$promise.then(function(a){e.accounts=a})["catch"](function(a){d.error(a)})}),h||(h=a(g)),i.append(h(e,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderAccountTemplate",["$compile","xAlert","$http","$timeout","Template","MailAccount",function(a,b,c,d,e,f){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/accountTemplate/actionBuilder.html",compile:function(c){function g(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var h,i;return h=c.contents().remove(),function(c,j){c.randomName=g(),d(function(){return e.get().$promise.then(function(a){c.templates=a}).then(function(){return f.get()}).then(function(a){c.accounts=a})["catch"](function(a){b.error(a)})}),i||(i=a(h)),j.append(i(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderClose",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/close/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderEmail",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/email/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderForward",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/forward/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderHttp",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/http/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),b.methods=["GET","POST"],e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderIntegration",["$compile","xAlert","$http","$timeout","Integration","$translate","ZendeskAccount","DeskAccount","SalesforceAccount","FreshdeskAccount","SugarcrmAccount",function(a,b,c,d,e,f,g,h,i,j,k){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/integration/actionBuilder.html",compile:function(c){function f(a,b){var c=[];for(a=a||5,
-b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var l,m;return l=c.contents().remove(),function(c,n){c.randomName=f(),d(function(){return e.get({active:1}).$promise.then(function(a){_.remove(a.rows,function(a){return"iframe"===a.state}),c.integrations=a.rows,c.element.data1&&o()})["catch"](function(a){b.error(a)})});var o=function(){var a;switch(c.element.data1){case"zendesk":a=g;break;case"desk":a=h;break;case"salesforce":a=i;break;case"freshdesk":a=j;break;case"sugarcrm":a=k}return a?a.get().$promise.then(function(a){c.accounts=a.rows,c.element.data2&&p()})["catch"](function(a){b.error(a)}):void 0},p=function(){c.configurations=_.find(c.accounts,{id:Number(c.element.data2)}).Configurations};c.changeIntegration=function(){c.element.data2="",o()},c.changeAccount=function(){c.element.data3="",p()},m||(m=a(l)),n.append(m(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderJscripty",["$compile","xAlert","$http","$timeout","Template","$translate","JscriptyProject",function(a,b,c,d,e,f,g){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/jscripty/actionBuilder.html",compile:function(c){var e,f;return e=c.contents().remove(),function(c,h){function i(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=i(),d(function(){return g.get().$promise.then(function(a){console.log(a),c.projects=a.rows})["catch"](function(a){b.error(a)})}),f||(f=a(e)),h.append(f(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderMotionBar",["$compile","xAlert","$http","$timeout","Template",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/motionbar/actionBuilder.html",compile:function(c){var f,g;return f=c.contents().remove(),function(c,h){function i(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.error(a)})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=j(),c.motionActions=[{name:"Popup",value:"0"},{name:"URL",value:"1"},{name:"Windows App",value:"2"}],c.changeMode=function(){c.element.data2="",c.element.data3="",i()},d(function(){return i()}),g||(g=a(f)),h.append(g(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderStatus",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/status/actionBuilder.html",compile:function(b){var c,d;return c=b.contents().remove(),function(b,e){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}b.randomName=f(),b.states=[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],d||(d=a(c)),e.append(d(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderTag",["$compile","xAlert","$http","$timeout","Tag",function(a,b,c,d,e){return{restrict:"E",scope:{myElement:"=element",form:"="},templateUrl:"components/directives/action/tag/actionBuilder.html",compile:function(c){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var g,h;return g=c.contents().remove(),function(c,i){console.log("myElement",c.myElement),c.randomName=f(),c.data={tags:c.myElement.data1?c.myElement.data1.split(";"):[]},c.$watch("data.tags",function(a){c.myElement.data1=a.join(";")}),d(function(){return e.get().$promise.then(function(a){c.tags=a.rows})["catch"](function(a){b.error(a)})}),h||(h=a(g)),i.append(h(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderTemplate",["$compile","xAlert","$http","$timeout","Template",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/template/actionBuilder.html",compile:function(c){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var g,h;return g=c.contents().remove(),function(c,i){c.randomName=f(),d(function(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.error(a)})}),h||(h=a(g)),i.append(h(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderUrlForward",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/urlforward/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),b.types=[{name:"HTTP GET",value:"GET"},{name:"HTTP POST",value:"POST"}],e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("conditionBuilder",["$compile","$timeout","$translate","xAlert",function(a,b,c,d){return{restrict:"E",scope:{element:"=",serviceindex:"=",service:"=",form:"="},templateUrl:"components/directives/condition/conditionBuilder.html",compile:function(e){var f,g;return f=e.contents().remove(),function(e,h){function i(a){var b=_.find(e.service.services[e.serviceindex].conditions,{value:a});if(b)if(e.elementType=b.type,b.arr)e.values=b.arr;else if(b.resource)return b.resource.get(b.params||{}).$promise.then(function(a){e.values=_.map(a.rows,function(a){return{name:a[b.resName||b.resValue],value:a[b.resValue]}})})["catch"](function(a){d.show(c.instant(a.message),"danger")})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}e._=_,e.randomName=j(),b(function(){e.element.field&&i(e.element.field)}),e.checkCondition=function(a){e.element.value="",e.element.operator="",i(a)},g||(g=a(f)),h.append(g(e,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").factory("xNotificationLicense",["Notification","$rootScope","$location",function(a,b,c){return{show:function(d){var e=b.$new();return e["class"]="alert-warning",e.icon="fa fa-exclamation-triangle",e.more=function(){c.path("/setting/license/view")},new a({delay:d,templateUrl:"components/factories/xNotificationLicense/xNotificationLicense.html",scope:e})}}}]),angular.module("xCallyShuttleApp").filter("secToTime",[function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}]),angular.module("xCallyShuttleApp").controller("FooterController",["$scope","Setting",function(a,b){a.year=moment().year(),a.$on("$includeContentLoaded",function(){Layout.initFooter()}),a.initFooter=function(){return b.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("HeaderController",["$scope","$rootScope","$location","$state","$http","$interval","$notification","Auth","xAlert","socket","xNotificationLicense","toastr","localStorageService","Agent","SmsReport","MailReport","OpenChannelReport","ChatReport","ChatRoom","xNotification","$timeout","$translate","$window","User","Pause","Action","FaxReport","List","MailAccount","ChatWebsite","FaxAccount","SmsAccount","OpenChannelAccount","ReportAgent","$uibModal","$log","ReportDial",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K){function L(a,b,c){return null===b&&(b=50),null===c&&(c="..."),a&&a.length>b?a.substring(0,b-c.length)+c:a}function M(b){var c,d="reason";switch(b){case"mail":c=p;break;case"chat":c=r;break;case"fax":c=A;break;case"sms":c=o;break;case"agent":c=H,d="lastevent";break;case"dial":c=K,d="dialstatus";break;case"openchannel":c=q;break;default:return}return c.get({limit:10,order:"updatedAt DESC"}).$promise.then(function(c){_.forEach(c.rows,function(a){if(a[d])switch(a[d].toLowerCase()){case"answer":case"connect":case"complete":a.status="taken";break;case"answered_elsewhere":a.status="taken_elsewhere";break;case"called":a.status="lost";break;case"busy":a.status="busy";break;case"rejected":a.status="rejected";break;case"cancel":case"abandoned":a.status="abandoned"}}),a.agentNotifications[b].rows=c.rows,j.socket.on("report_"+b+":save",function(c){c.status="none",a.agentNotifications[b].rows.unshift(c),"agent"!==b&&"dial"!==b&&(a.agentNotifications[b].timeout[c.id]=setTimeout(function(){clearTimeout(a.agentNotifications[b].timeout[c.id]),_.find(a.agentNotifications[b].rows,{id:c.id}).status="lost",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++,delete a.agentNotifications[b].timeout[c.id]},1e3*c.timeslot))}),j.socket.on("report_"+b+":update",function(c){if("agent"===b){var e=_.find(a.activeCalls,{id:c.id});e&&(c.agentcomplete||c.agentringnoanswer||c.agentdump)?_.remove(a.activeCalls,{id:c.id}):!c.agentconnectAt||c.agentcomplete||c.agentringnoanswer||c.agentdump||a.activeCalls.push(c)}var f=_.find(a.agentNotifications[b].rows,{id:c.id});if(f&&("agent"!==b&&"dial"!==b&&a.agentNotifications[b].timeout[c.id]&&(clearTimeout(a.agentNotifications[b].timeout[c.id]),delete a.agentNotifications[b].timeout[c.id]),c[d])){switch(c[d].toLowerCase()){case"answer":case"connect":case"complete":c.status="taken";break;case"answered_elsewhere":c.status="taken_elsewhere",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications.chat["new"]++;break;case"busy":c.status="busy",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++;break;case"rejected":c.status="rejected";break;case"cancel":case"abandoned":c.status="abandoned",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++}_.merge(f,c)}})})["catch"](function(a){i.error(a)})}function N(){return a.headerAgent=h.getCurrentUser(),a.readyTimer=1e3*moment().unix(),y.get().$promise.then(function(b){a.headerPauses=b.rows,j.syncUpdates("pause",a.headerPauses)})["finally"](function(){j.socket.on("agent:save",function(b){a.headerAgent.id===b.id&&(_.merge(a.headerAgent,b),b.voicePause&&b.mailPause&&b.chatPause&&b.faxPause&&b.smsPause&&b.openchannelPause||(a.readyTimer=1e3*moment().unix()),b.online||a.logout())})})["catch"](function(a){console.log("Error synchronizing agent status:",a)})}function O(){return H.get({id:"active",controller:"calls"}).$promise.then(function(b){a.activeCalls=b.rows})["catch"](function(a){i.error(a)})}a.moment=moment,$(document).on("click",".tabbed-dropdown",function(a){a.stopPropagation()}),a.license.token!==a.license.token2&&(h.isAdmin()||h.isUser())&&f(function(){"main.setting.license.view"!==d.current.name&&k.show(3e4)},3e4),a.openRoom=function(b,c){var d=_.find(a.workspaces,{id:b,type:c});if(d)d.active=!0;else{var e;switch(c){case"mailRoom":e="icon-envelope";break;case"chatRoom":e="fa fa-users";break;case"faxRoom":e="icon-paper-plane";break;case"smsRoom":e="glyphicon glyphicon-comment";break;case"openchannelRoom":e="icon-globe"}a.workspaces.push({id:b,type:c,"class":e,active:!0})}},a.toggleSidebar=function(){b.settings.layout.pageSidebarClosed=!b.settings.layout.pageSidebarClosed,m.set("sidebarClosed",b.settings.layout.pageSidebarClosed)},a.chooseContact=function(b){var c=I.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{data:function(){return{type:"detail",phone:b,mobile:b}}}});c.result.then(function(c){c?a.openContactTab(c):a.newContact({calleridnum:b})},function(){J.info("Modal dismissed at: "+new Date)})},a.loadNotifications=function(b){if(!a.busyLoad[b].end){a.busyLoad[b].busy=!0;var c,d="reason";switch(b){case"mail":c=p;break;case"chat":c=r;break;case"fax":c=A;break;case"sms":c=o;break;case"agent":c=H,d="lastevent";break;case"dial":c=K,d="dialstatus";break;case"openchannel":c=q;break;default:return}return c.get({limit:10,offset:a.agentNotifications[b].rows.length,order:"updatedAt DESC"}).$promise.then(function(c){c.rows.length?(_.forEach(c.rows,function(a){if(a[d])switch(a[d].toLowerCase()){case"answer":case"connect":case"complete":a.status="taken";break;case"answered_elsewhere":a.status="taken_elsewhere";break;case"called":a.status="lost";break;case"busy":a.status="busy";break;case"rejected":a.status="rejected";break;case"abandoned":a.status="abandoned"}}),a.agentNotifications[b].rows=a.agentNotifications[b].rows.concat(c.rows)):a.busyLoad[b].end=!0,a.busyLoad[b].busy=!1})["catch"](function(a){i.error(a)})}},a.headerPause=function(b,c,d){return z.save({name:b,agent:a.headerAgent.id,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:d||"all"}).$promise.then(function(){i.show(v.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){i.error(a)})},"agent"===h.getCurrentUser().role&&(N(),a.agentNotifications={mail:{rows:[],"new":0,timeout:{}},chat:{rows:[],"new":0,timeout:{}},fax:{rows:[],"new":0,timeout:{}},sms:{rows:[],"new":0,timeout:{}},agent:{rows:[],"new":0},dial:{rows:[],"new":0},openchannel:{rows:[],"new":0}},a.busyLoad={mail:{busy:!1,end:!1},chat:{busy:!1,end:!1},fax:{busy:!1,end:!1},sms:{busy:!1,end:!1},agent:{busy:!1,end:!1},dial:{busy:!1,end:!1},openchannel:{busy:!1,end:!1}},O(),M("agent"),M("dial"),a.license.mail&&M("mail"),a.license.chat&&M("chat"),a.license.fax&&M("fax"),a.license.messaging&&M("sms"),a.license.openchannel&&M("openchannel")),j.socket.on("user_has_chat_room:save",function(b){var c;return s.get({id:Number(b.ChatRoomId)}).$promise.then(function(b){console.log("chatRoom",b),c=b;var d=_.find(a.workspaces,{id:Number(c.id),type:"chatRoom"});d?d.name=a.getFullnames(c):a.workspaces.push({id:c.id,name:a.getFullnames(c),type:"chatRoom","class":"icon-bubble",unread:1})})["catch"](function(a){console.error(a)})}),j.socket.on("chat_message:save",function(b){var c;if(b.UserId!==h.getCurrentUser().id){var d=_.find(a.workspaces,{id:Number(b.ChatRoomId),type:"chatRoom"});if(!d)return s.get({id:Number(b.ChatRoomId)}).$promise.then(function(b){c=b,a.workspaces.push({id:c.id,name:a.getFullnames(b),type:"chatRoom","class":"icon-bubble",unread:1})})["catch"](function(a){console.error(a)})}});var P=function(){return w.Notification},Q=function(){b.settings.layout.onFocus=!0},R=function(){b.settings.layout.onFocus=!1};w.onfocus=Q,w.onblur=R,a.getFullnames=function(a){var b=_.map(a.Users,"fullname");return a.ChatVisitor&&b.unshift(a.ChatVisitor.fullname),_.without(b,h.getCurrentUser().fullname).join(", ")},a.openContact=function(b,c,d){if(d&&"<unknown>"!==d){var e,f;switch(b){case"mail":e=C,f={email:d};break;case"chat":e=D,f={email:d};break;case"fax":e=E,f={fax:d};break;case"sms":e=F,f={mobile:d};break;default:return}return e.get({id:c}).$promise.then(function(a){return a.ListId?B.save({listId:a.ListId,controller:"contacts"},f).$promise:null}).then(function(b){if(b){var c=_.find(a.workspaces,{contactID:b.id});c?c.active=!0:a.workspaces.push({active:!0,"class":"icon-user",contactID:b.id,name:b.email,type:"contact"})}else i.show(v.instant("MESSAGE_NO_LIST_CONFIGURED"),"info")})["catch"](function(a){console.error(a)})}},a.initHeader=function(){"agent"===h.getCurrentUser().role&&(j.socket.on("report_chat:save",function(a){P&&!b.settings.layout.onFocus&&g("CHAT CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Chat Visitor!",delay:1e3*a.timeslot});var c="<b>"+v.instant("APPLICATION_FROM")+"</b>: "+a.visitorname+"<br><b>"+v.instant("APPLICATION_EMAIL")+"</b>: "+a.visitoremail;"queue"===a.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+a.queuename),t.show(v.instant("APPLICATION_NEW_CHAT_REQUEST"),c,"chat",1e3*a.timeslot,function(){return r.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){i.show("Chat properly assigned","success")})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_CHAT_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return r.get({id:a.id,controller1:"reject"}).$promise.then(function(){i.show("Chat properly rejected","success")})["catch"](function(a){i.error(a)})})}),j.socket.on("report_mail:save",function(c){var d=_.find(a.workspaces,{id:c.roomid,type:"mailRoom"});if(!d){var e="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+c.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+c.from+"<br> <b>"+v.instant("APPLICATION_SUBJECT")+"</b>: "+(L(c.subject,30,"...")||"No subject");"queue"===c.application&&(e+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+c.queuename),t.show(v.instant("APPLICATION_NEW_MAIL_REQUEST"),e,"mail",1e3*c.timeslot,function(){return p.get({id:c.id,controller1:"accept",controller2:c.uniqueid}).$promise.then(function(){var b=_.find(a.workspaces,{id:c.roomid,type:"mailRoom"});b?b.active=!0:a.workspaces.push({id:c.roomid,name:c.subject||"No subject",type:"mailRoom","class":"icon-envelope",active:!0,unread:0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_MAIL_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return p.get({id:c.id,controller1:"reject"}).$promise["catch"](function(a){i.error(a)})}),P&&!b.settings.layout.onFocus?g("MAIL CHANNEL",{icon:"assets/images/media/channels/mail64.png",body:"NEW Incoming Mail Message!",delay:1e3*c.timeslot}):console.log("Notification API not supported in your browser")}}),j.socket.on("report_sms:save",function(b){var c="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+b.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+b.from;"queue"===b.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+b.queuename),t.show(v.instant("APPLICATION_NEW_SMS_REQUEST"),c,"sms",1e3*b.timeslot,function(){return o.get({id:b.id,controller1:"accept",controller2:b.uniqueid}).$promise.then(function(){var c=_.find(a.workspaces,{id:b.roomid,type:"smsRoom"});c?c.active=!0:a.workspaces.push({id:b.roomid,name:b.from,type:"smsRoom","class":"glyphicon glyphicon-comment",active:!0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_SMS_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return o.get({id:b.id,controller1:"reject"}).$promise.then(function(){i.show("SMS properly rejected","success")})["catch"](function(a){i.error(a)})}),P?g("SMS CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming SMS Message!",delay:1e3*b.timeslot}):console.log("Notification API not supported in your browser")}),j.socket.on("report_openchannel:save",function(b){var c="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+b.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+b.from;"queue"===b.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+b.queuename),t.show(v.instant("APPLICATION_NEW_MESSAGE"),c,"openchannel",1e3*b.timeslot,function(){return q.get({id:b.id,controller1:"accept",controller2:b.uniqueid}).$promise.then(function(){var c=_.find(a.workspaces,{id:b.roomid,type:"openchannelRoom"});c?c.active=!0:a.workspaces.push({id:b.roomid,name:b.from,type:"openchannelRoom","class":"icon-globe",active:!0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return q.get({id:b.id,controller1:"reject"}).$promise.then(function(){i.show("Message properly rejected","success")})["catch"](function(a){i.error(a)})}),P?g("OPEN CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Message!",delay:1e3*b.timeslot}):console.log("Notification API not supported in your browser")}),j.socket.on("report_fax:save",function(c){var d=_.find(a.workspaces,{id:c.roomid,type:"faxRoom"});if(!d){var e="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+c.accountname+"<br>               <b>"+v.instant("APPLICATION_PHONE")+"</b>: "+c.from;"queue"===c.application&&(e+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+c.queuename),t.show(v.instant("APPLICATION_NEW_FAX_REQUEST"),e,"fax",1e3*c.timeslot,function(){return A.get({id:c.id,controller1:"accept",controller2:c.uniqueid}).$promise.then(function(){var b=_.find(a.workspaces,{id:c.roomid,type:"faxRoom"});b?b.active=!0:a.workspaces.push({id:c.roomid,name:c.from,type:"faxRoom","class":"icon-paper-plane",active:!0,unread:0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_FAX_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return A.get({id:c.id,controller1:"reject"}).$promise["catch"](function(a){i.err(a)})}),P&&!b.settings.layout.onFocus?g("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*c.timeslot}):console.log("Notification API not supported in your browser")}}))},a.logout=function(){return e.get("/auth/local/logout").success(function(){h.logout(),c.path("/login")}).error(function(a){console.error(a)})},a.isActive=function(a){return a===c.path()},a.$on("$destroy",function(){console.log("header $destroy"),j.unsyncUpdates("pause"),j.unsyncUpdates("agent"),j.unsyncUpdates("report_chat"),j.unsyncUpdates("report_mail"),j.unsyncUpdates("report_fax"),j.unsyncUpdates("report_sms"),j.unsyncUpdates("report_openchannel"),j.unsyncUpdates("user_has_chat_room"),j.unsyncUpdates("chat_message")})}]),angular.module("xCallyShuttleApp").factory("Modal",["$rootScope","$uibModal",function(a,b){function c(c,d){var e=a.$new();return c=c||{},d=d||"modal-default",angular.extend(e,c),b.open({templateUrl:"components/modal/delete.html",windowClass:d,scope:e})}return{confirm:{"delete":function(a){return a=a||angular.noop,function(){var b,d=Array.prototype.slice.call(arguments),e=d.shift();b=c({modal:{dismissable:!0,title:"Confirm Delete",html:"<p>Are you sure you want to delete"+(e?"<strong> "+e+"</strong>":" selected items")+"?</p>",buttons:[{classes:"btn red",text:"Delete",click:function(a){b.close(a)}},{classes:"btn default",text:"Cancel",click:function(a){b.dismiss(a)}}]}},"over-topbar center"),b.result.then(function(b){a.apply(b,d)})}}}}}]),angular.module("xCallyShuttleApp").service("application",function(){var a={applications:[{type:null,name:"APPLICATION_QUEUE",value:"Queue"},{type:null,name:"APPLICATION_PLAYBACK",value:"Playback"},{type:null,name:"Dial",value:"Dial"},{type:"internalDial",name:"APPLICATION_INTERNAL_DIAL",value:"Dial"},{type:"externalDial",name:"APPLICATION_EXTERNAL_DIAL",value:"Dial"},{type:"RingGroup",name:"Ring Group",value:"Dial"},{type:null,name:"Cally-Square Project",value:"AGI"},{type:null,name:"GoTo",value:"Goto"},{type:null,name:"Hangup",value:"Hangup"},{type:null,name:"Set",value:"Set"},{type:"custom",name:"Custom",value:"custom"},{type:null,name:"APPLICATION_VOICEMAIL",value:"Voicemail"}],queueOptions:[{value:"C",name:"APPLICATION_QUEUE_OPTION_C"},{value:"c",name:"APPLICATION_QUEUE_OPTION_c"},{value:"d",name:"APPLICATION_QUEUE_OPTION_d"},{value:"F",name:"APPLICATION_QUEUE_OPTION_F"},{value:"h",name:"APPLICATION_QUEUE_OPTION_h"},{value:"H",name:"APPLICATION_QUEUE_OPTION_H"},{value:"n",name:"APPLICATION_QUEUE_OPTION_n"},{value:"i",name:"APPLICATION_QUEUE_OPTION_i"},{value:"I",name:"APPLICATION_QUEUE_OPTION_I"},{value:"r",name:"APPLICATION_QUEUE_OPTION_r"},{value:"R",name:"APPLICATION_QUEUE_OPTION_R"},{value:"t",name:"APPLICATION_QUEUE_OPTION_t"},{value:"T",name:"APPLICATION_QUEUE_OPTION_T"},{value:"w",name:"APPLICATION_QUEUE_OPTION_w"},{value:"W",name:"APPLICATION_QUEUE_OPTION_W"},{value:"k",name:"APPLICATION_QUEUE_OPTION_k"},{value:"K",name:"APPLICATION_QUEUE_OPTION_K"},{value:"x",name:"APPLICATION_QUEUE_OPTION_x"},{value:"X",name:"APPLICATION_QUEUE_OPTION_X"}],audioOptions:[{value:"skip",name:"APPLICATION_PLAYBACK_OPTION_SKIP"},{value:"noanswer",name:"APPLICATION_PLAYBACK_OPTION_NOANSWER"},{value:"j",name:"APPLICATION_PLAYBACK_OPTION_J"},{value:"say",name:"APPLICATION_PLAYBACK_OPTION_SAY"}],hangupCauses:[{value:"",name:"--"},{value:"1",name:"APPLICATION_HANGUP_CAUSE_1"},{value:"16",name:"APPLICATION_HANGUP_CAUSE_16"},{value:"17",name:"APPLICATION_HANGUP_CAUSE_17"},{value:"18",name:"APPLICATION_HANGUP_CAUSE_18"},{value:"21",name:"APPLICATION_HANGUP_CAUSE_21"},{value:"22",name:"APPLICATION_HANGUP_CAUSE_22"},{value:"27",name:"APPLICATION_HANGUP_CAUSE_27"},{value:"38",name:"APPLICATION_HANGUP_CAUSE_38"},{value:"41",name:"APPLICATION_HANGUP_CAUSE_41"}],intTypes:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"custom",name:"APPLICATION_CUSTOM"},{value:"list",name:"APPLICATION_FROM_LIST"}],checkUnderscore:function(a){return 0===a.indexOf("_")?a:"_"+a}};return{application:a}}),angular.module("xCallyShuttleApp").service("automations",function(){var a={mail:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},chat:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},fax:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]}},b=["mail","fax","chat"];return{services:a,channels:b}}),angular.module("xCallyShuttleApp").service("channel",function(){var a=[{name:"Voice",value:"voice"}];return a}),angular.module("xCallyShuttleApp").service("desk_com",function(){var a=[{id:"priority",label:"Priority",custom:!1,data:{choices:[1,2,3,4,5,6,7,8,9,10]}},{id:"status",label:"Status",custom:!1,data:{choices:["new","open","pending","resolved","closed"]}},{id:"type",label:"Type",custom:!1,data:{choices:["chat","twitter","email","qna","facebook","phone"]}}];return{fields:a}}),angular.module("xCallyShuttleApp").service("interval",function(){var a={months:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"jan",name:"APPLICATION_JANUARY"},{value:"feb",name:"APPLICATION_FEBRUARY"},{value:"mar",name:"APPLICATION_MARCH"},{value:"apr",name:"APPLICATION_APRIL"},{value:"may",name:"APPLICATION_MAY"},{value:"jun",name:"APPLICATION_JUNE"},{value:"jul",name:"APPLICATION_JULY"},{value:"aug",name:"APPLICATION_AUGUST"},{value:"sep",name:"APPLICATION_SEPTEMBER"},{value:"oct",name:"APPLICATION_OCTOBER"},{value:"nov",name:"APPLICATION_NOVEMBER"},{value:"dec",name:"APPLICATION_DECEMBER"}],monthsNumber:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"1",name:"APPLICATION_JANUARY"},{value:"2",name:"APPLICATION_FEBRUARY"},{value:"3",name:"APPLICATION_MARCH"},{value:"4",name:"APPLICATION_APRIL"},{value:"5",name:"APPLICATION_MAY"},{value:"6",name:"APPLICATION_JUNE"},{value:"7",name:"APPLICATION_JULY"},{value:"8",name:"APPLICATION_AUGUST"},{value:"9",name:"APPLICATION_SEPTEMBER"},{value:"10",name:"APPLICATION_OCTOBER"},{value:"11",name:"APPLICATION_NOVEMBER"},{value:"12",name:"APPLICATION_DECEMBER"}],daysOfWeek:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"mon",name:"APPLICATION_MONDAY"},{value:"tue",name:"APPLICATION_TUESDAY"},{value:"wed",name:"APPLICATION_WEDNESDAY"},{value:"thu",name:"APPLICATION_THURSDAY"},{value:"fri",name:"APPLICATION_FRIDAY"},{value:"sat",name:"APPLICATION_SATURDAY"},{value:"sun",name:"APPLICATION_SUNDAY"}],daysOfMonth:["always",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]};return{interval:a}}),angular.module("xCallyShuttleApp").service("report",["ReportAgent","ReportCall","ReportMailSession","ReportMember","ReportQueue","ReportIntegration","ReportChatSession","ReportSmsSession","Contact","Recording","ReportSquare","ReportSquareDetail","User","ReportFaxSession","MailRoom","MailMessage","FaxRoom","FaxMessage","ChatRoom","ChatMessage","SmsRoom","SmsMessage","OpenChannelRoom","OpenChannelMessage","ReportOpenChannelSession",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){var z=[{value:"users",resource:m,channel:"General"},{value:"cm_contacts",resource:i,channel:"General"},{value:"report_integration_history",resource:f,channel:"General"},{value:"report_agent_history",resource:a,channel:"Voice"},{value:"report_call_history",resource:b,channel:"Voice"},{value:"report_member_history",resource:d,channel:"Voice"},{value:"report_queue_history",resource:e,channel:"Voice"},{value:"voice_recordings",resource:j,channel:"Voice"},{value:"report_square_history",resource:k,channel:"Voice"},{value:"report_square_details_history",resource:l,channel:"Voice"},{value:"report_chat_session_history",resource:g,channel:"Chat"},{value:"chat_rooms",resource:s,channel:"Chat"},{value:"chat_messages",resource:t,channel:"Chat"},{value:"report_mail_session_history",resource:c,channel:"Mail"},{value:"mail_rooms",resource:o,channel:"Mail"},{value:"mail_messages",resource:p,channel:"Mail"},{value:"report_fax_session_history",resource:n,channel:"Fax"},{value:"fax_rooms",resource:q,channel:"Fax"},{value:"fax_messages",resource:r,channel:"Fax"},{value:"report_sms_session_history",resource:h,channel:"Sms"},{value:"sms_rooms",resource:u,channel:"Sms"},{value:"sms_messages",resource:v,channel:"Sms"},{value:"report_openchannel_session_history",resource:y,channel:"Open Channel"},{value:"openchannel_rooms",resource:w,channel:"Open Channel"},{value:"openchannel_messages",resource:x,channel:"Open Channel"}];return{tables:z}}]),angular.module("xCallyShuttleApp").service("strategies",function(){return["beepall","roundrobin","rrmemory"]}),angular.module("xCallyShuttleApp").service("triggers",["VoiceQueue","Route",function(a,b){var c={voice:{conditions:[{name:"APPLICATION_QUEUE",value:"queue",type:"select",resource:a,resValue:"name",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CALL_STATUS",value:"lastevent",type:"select",arr:[{name:"ringing",value:"called"},{name:"up",value:"connect"},{name:"hangup",value:"complete"
-},{name:"rejected",value:"rejected"},{name:"abandoned",value:"abandoned"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_OUTBOUND_ROUTE",value:"routeId",type:"select",resource:b,resValue:"id",resName:"exten",params:{type:"outbound"},operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"},{name:"APPLICATION_INTEGRATIONS",value:"integration",propertyField:"select"},{name:"APPLICATION_MOTION_BAR",value:"motionbar",propertyField:"select"},{name:"APPLICATION_JSCRIPTY",value:"jscripty",propertyField:"select"},{name:"APPLICATION_URL_FORWARD",value:"urlForward"}]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_TO",value:"to",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_CC",value:"cc",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_SUBJECT",value:"subject",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_BODY",value:"text",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_TEMPLATE",value:"template"},{name:"APPLICATION_EMAIL",value:"email"},{name:"APPLICATION_FORWARD",value:"forward"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]},chat:{conditions:[{name:"APPLICATION_NAME",value:"fullname",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_EMAIL",value:"email",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_EMAIL",value:"accountEmail"},{name:"APPLICATION_TEMPLATE",value:"accountTemplate"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]},sms:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_BODY",value:"body",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_EMAIL",value:"accountEmail"},{name:"APPLICATION_TEMPLATE",value:"accountTemplate"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]}},d=["voice","mail","chat","sms"];return{services:c,channels:d}}]),angular.module("xCallyShuttleApp").service("variable",function(){var a=[{title:"Unique ID",name:"uniqueid",group:"voice_queue"},{title:"Caller Number",name:"calleridnum",group:"voice_queue"},{title:"Caller Name",name:"calleridname",group:"voice_queue"},{title:"Queue",name:"queue",group:"voice_queue"},{title:"Called Number",name:"destcalleridnum",group:"voice_queue"},{title:"Called Name",name:"destcalleridname",group:"voice_queue"},{title:"Hold Time",name:"holdtime",group:"voice_queue"},{title:"Talk Time",name:"talktime",group:"voice_queue"},{title:"Connected Time",name:"agentconnectAt",group:"voice_queue"},{title:"Called Time",name:"agentcalledAt",group:"voice_queue"},{title:"DNID",name:"destexten",group:"voice_queue"},{title:"Complete Time",name:"agentcompleteAt",group:"voice_queue"},{title:"No Answer Time",name:"agentringnoanswerAt",group:"voice_queue"},{title:"Recording URL",name:"recordingURL",group:"voice_queue"},{title:"Unique ID",name:"uniqueid",group:"voice_outbound"},{title:"Caller Number",name:"calleridnum",group:"voice_outbound"},{title:"Caller Name",name:"calleridname",group:"voice_outbound"},{title:"Called Number",name:"destcalleridnum",group:"voice_outbound"},{title:"Called Name",name:"destcalleridname",group:"voice_outbound"},{title:"Start Time",name:"starttime",group:"voice_outbound"},{title:"Answer Time",name:"answertime",group:"voice_outbound"},{title:"Complete Time",name:"endtime",group:"voice_outbound"},{title:"Recording URL",name:"recordingURL",group:"voice_outbound"},{title:"Member Name",name:"membername",group:"voice_outbound"}];return a}),angular.module("xCallyShuttleApp").controller("SidebarController",["$scope","$rootScope","$resource","$location","Auth","Dashboard","Integration","xAlert","$stateParams","socket","$uibModal","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l){a.Auth=e,a.$on("$includeContentLoaded",function(){Metronic.init(),Layout.initSidebar()}),a.getSidebarDashboards=function(){return f.get().$promise.then(function(b){a.dashboards=b.rows,j.syncUpdates("dashboard",a.dashboards)})["catch"](function(){h.show("Error loading your dashboards","danger")})},a.about=function(){k.open({animation:!0,size:"sm",templateUrl:"app/main/about.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.year=moment().year(),a.getInfo=function(){return l.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},a.close=function(){b.dismiss("cancel")}}]})},a.getSidebarIntegrations=function(){return e.isAdmin()||e.isAgent()||b.userModules[19]?g.get().$promise.then(function(b){a.integrations=b.rows,j.syncUpdates("integration",a.integrations)})["catch"](function(a){h.error(a)}):void 0},a.$on("sidebar $destroy",function(){console.log("destroy"),j.unsyncUpdates("dashboard"),j.unsyncUpdates("integration")})}]),angular.module("xCallyShuttleApp").factory("socket",["$rootScope","$window","socketFactory","Auth",function(a,b,c,d){var e=d.getCurrentUser(),f=io("",{query:"token="+d.getToken()+"&userId="+e.id+"&name="+e.name+"&role="+(e.role||"agent")+"&source=browser",path:"/socket.io-client"}),g=c({ioSocket:f});return a.$on("logout",function(){g&&(g.disconnect(!0),b.location.reload())}),{socket:g,syncUpdates:function(a,b,c){c=c||angular.noop,g.on(a+":save",function(a){var d=_.find(b,{id:a.id}),e=b.indexOf(d),f="created";d?(_.merge(b[e],a),f="updated"):b.unshift(a),c(f,a,b)}),g.on(a+":remove",function(a){var d="deleted";_.remove(b,{id:a.id}),c(d,a,b)})},unsyncUpdates:function(a){g.removeAllListeners(a+":save"),g.removeAllListeners(a+":remove")},syncUpdatesByAttributes:function(a,b,c,d){d=d||angular.noop,g.on(a+":save",function(a){var e=!0;if(_.forIn(b,function(b,c){return a[c]&&a[c]===b?!0:e=!1}),e){var f=_.find(c,{id:a.id}),g=c.indexOf(f),h="created";f?(_.merge(c[g],a),h="updated"):c.unshift(a),d(h,a,c)}}),g.on(a+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},syncMailMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncMailMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")},syncFaxMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncFaxMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")}}}]),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("counter",{title:"Single Value",description:"Single Value for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["Widget",function(a){return{get:function(b){return a.get({select:b.select,condition:encodeURIComponent(b.condition),table:b.report.replace("_history",""),controller:"counter"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiwidgetCounterEditCtrl",["$scope","report",function(a,b){a.config.reportTables=b.tables,a.config.colors=[{name:"Grey",value:"grey"},{name:"Grey 2",value:"grey-cascade"},{name:"Grey 3",value:"grey-silver"},{name:"Grey 4",value:"grey-steel"},{name:"Grey 5",value:"grey-carrara"},{name:"Grey 6",value:"grey-gallery"},{name:"Blue",value:"blue"},{name:"Blue 2",value:"blue-hoki"},{name:"Blue 3",value:"blue-steel"},{name:"Blue 4",value:"blue-madison"},{name:"Blue 5",value:"blue-chambray"},{name:"Blue 6",value:"blue-ebonyclay"},{name:"Red",value:"red"},{name:"Red 2",value:"red-pink"},{name:"Red 3",value:"red-sunglo"},{name:"Red 4",value:"red-intense"},{name:"Red 5",value:"red-thunderbird"},{name:"Red 6",value:"red-flamingo"},{name:"Green",value:"green"},{name:"Green 2",value:"green-meadow"},{name:"Green 3",value:"green-seagreen"},{name:"Green 4",value:"green-turquoise"},{name:"Green 5",value:"green-haze"},{name:"Green 6",value:"green-jungle"},{name:"Purple",value:"purple"},{name:"Purple 2",value:"purple-plum"},{name:"Purple 3",value:"purple-medium"},{name:"Purple 4",value:"purple-studio"},{name:"Purple 5",value:"purple-wisteria"},{name:"Purple 6",value:"purple-seance"},{name:"Yellow",value:"yellow"},{name:"Yellow 2",value:"yellow-gold"},{name:"Yellow 3",value:"yellow-casablanca"},{name:"Yellow 4",value:"yellow-crusta"},{name:"Yellow 5",value:"yellow-lemon"},{name:"Yellow 6",value:"yellow-saffron"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"},{name:"Volume Control Phone",value:"fa-volume-control-phone"},{name:"Comments",value:"fa-comments-o"},{name:"Commenting",value:"fa-commenting-o"},{name:"Coffee",value:"fa-coffee"},{name:"Clock",value:"fa-clock-o"},{name:"Envelope",value:"fa-envelope-o"},{name:"Hourglass",value:"fa-hourglass-half"},{name:"Percent",value:"fa-percent"}],a.config.select=a.config.select?a.config.select:"COUNT(*)",a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.condition=a.config.condition?a.config.condition:null,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.report&&c.get(a.config).then(function(b){b?b.result&&b.result.length>1||_.keys(b.result[0]).length>1?(a.tooManyResults=!0,a.result=null):(a.tooManyResults=!1,null!==_.values(b.result[0])[0]?a.result=_.values(b.result[0])[0].toString():a.result="--"):a.result=null})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label for=select>Select</label> <input type=text class=form-control id=condition ng-model=config.select placeholder=Select></div><div class=form-group><label class=control-label>From</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=From>{{'APPLICATION_'+$select.selected.value.toUpperCase() | translate}}</ui-select-match><ui-select-choices repeat=\"table.value as table in config.reportTables | filter: $select.search\"><div ng-bind-html=\"'APPLICATION_'+table.value.toUpperCase() | translate | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>Where</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=Where></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=5></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\"><div data-ng-class=\"'bg-'+$select.selected.value\">&nbsp;</div></ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div data-ng-class=\"'bg-'+color.value\">&nbsp;</div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\"><i class=fa ng-class=$select.selected.value></i></ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><i class=fa ng-class=icon.value></i></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),a.put("{widgetsPath}/counter/src/view.html",'<div class=dashboard-stat ng-class=config.color ng-if=result><div class=visual><i class=fa ng-class=config.icon></i></div><div class=details><div class=number>{{result}}</div><div class=desc>{{config.details}}</div></div><a class=more href={{config.link}}>{{config.linkText}} <i class="m-icon-swapright m-icon-white"></i></a></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=tooManyResults><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_TOO_MANY_RESULTS\' | translate}}</div><div class="alert alert-danger" role=alert ng-if="!result && !tooManyResults"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_QUERY_NOT_VALID\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.pie-chart",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("pie-chart",{title:"Pie-Chart",description:"Display a pie-chart starting from DB values",templateUrl:"{widgetsPath}/pie-chart/src/view.html",controller:"apiWidgetPieChartViewCtrl",edit:{templateUrl:"{widgetsPath}/pie-chart/src/edit.html",controller:"apiWidgetPieChartEditCtrl"}})}]).service("apiServicePieChart",["Widget",function(a){return{get:function(b){return a.get({condition:encodeURIComponent(b.condition),table:b.report.replace("_history",""),fields:b.fields,controller:"piechart"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiWidgetPieChartEditCtrl",["$scope","report",function(a,b){function c(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=b.tables,a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){c().push({})},a.removeField=function(a){c().splice(a,1)}}]).controller("apiWidgetPieChartViewCtrl",["$scope","$interval","apiServicePieChart",function(a,b,c){a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.pieChartApiCall=function(){a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){if(b&&b.result&&1===b.result.length){a.labels=[],a.data=[];for(var c in b.result[0])a.labels.push(c),a.data.push(b.result[0][c])}else a.labels=[],a.data=[]})},a.pieChartApiCall();var d=b(function(){a.pieChartApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.pie-chart").run(["$templateCache",function(a){a.put("{widgetsPath}/pie-chart/src/edit.html","<form role=form><div class=form-group><label class=control-label>{{'APPLICATION_REPORT' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_REPORT' | translate }}\">{{'APPLICATION_'+$select.selected.value.toUpperCase() | translate}}</ui-select-match><ui-select-choices repeat=\"table.value as table in config.reportTables | filter: $select.search\"><div ng-bind-html=\"'APPLICATION_'+table.value.toUpperCase() | translate | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{'APPLICATION_FIELDS' | translate}}</label></div><div class=padding-bottom ng-repeat=\"field in config.fields\"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if=\"config.fields.length>1\"><button class=\"btn btn-danger\" type=button data-ng-click=removeField($index)><i class=\"fa fa-times\"></i> {{'APPLICATION_REMOVE' | translate}}</button></span></div></div></div><button type=button class=\"btn btn-sm green mbottom20\" ng-click=addField()><i class=\"fa fa-plus\"></i> {{'APPLICATION_ADD_FIELD' | translate}}</button><div class=form-group><label for=condition>{{'APPLICATION_CONDITION' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=\"{{'APPLICATION_CONDITION' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=5></div></form>"),a.put("{widgetsPath}/pie-chart/src/view.html",'<div ng-if=labels.length ng-style=config.style><canvas id=doughnut class="chart chart-doughnut" chart-data=data chart-labels=labels legend=true></canvas></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_METRIC_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.table",["adf.provider"]).value("apiServiceUrlTable","/api/widgets/table").config(["dashboardProvider",function(a){a.widget("table",{title:"Table",description:"Show tabbed results from db",templateUrl:"{widgetsPath}/table/src/view.html",controller:"apiWidgetTableViewCtrl",edit:{templateUrl:"{widgetsPath}/table/src/edit.html",controller:"apiWidgetTableEditCtrl"}})}]).service("apiServiceTable",["$q","$http","apiServiceUrlTable",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetTableEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetTableViewCtrl",["$scope","$interval","apiServiceTable",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.style={"max-height":a.config.height+"px",overflow:"scroll"},a.tableApiCall=function(){a.config.condition&&a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){a.results=b})},a.tableApiCall();var d=b(function(){a.tableApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.table").run(["$templateCache",function(a){a.put("{widgetsPath}/table/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_METRICS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div><div class=form-group><label for=condition>{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}</label> <input type=number class=form-control id=height ng-model=config.height placeholder="{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}" min=350></div></form>'),a.put("{widgetsPath}/table/src/view.html",'<div ng-if=results ng-style=config.style><table st-table=results class="table table-striped table-bordered table-hover"><div class=table-responsive><thead><tr><th colspan={{config.fields.length}}><div class=row><div class=col-md-6></div><div class=col-md-6><div class="input-group input-medium pull-right"><input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class=form-control type=search> <span class=input-group-addon><i class="fa fa-search"></i></span></div></div></div></th></tr><tr><th ng-repeat="field in config.fields">{{field.alias}}</th></tr></thead><tbody><tr data-ng-repeat="result in results" class=animate-repeat><td ng-repeat="field in config.fields">{{result[field.alias]}}</td></tr><tr data-ng-hide=results.length><td colspan={{config.fields.length}} style=text-align:center;><i>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</i></td></tr></tbody><tfoot><tr><td colspan={{config.fields.length}} class=text-center><div st-pagination class=pagination st-items-by-page=10 st-displayed-pages=3></div></td></tr></tfoot></div></table></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_FIELD_AND_CHECK_OTHER\' | translate}}</div>')}])}(window);var Metronic=function(){var a,b=!1,c=!1,d=!1,e=!1,f=[],g="assets/",h="img/",i="plugins/",j="css/",k={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},l=function(){"rtl"===$("body").css("direction")&&(b=!0),c=!!navigator.userAgent.match(/MSIE 8.0/),d=!!navigator.userAgent.match(/MSIE 9.0/),e=!!navigator.userAgent.match(/MSIE 10.0/),e&&$("html").addClass("ie10"),(e||d||c)&&$("html").addClass("ie")},m=function(){for(var a=0;a<f.length;a++){var b=f[a];b.call()}},n=function(){var a;if(c){var b;$(window).resize(function(){b!=document.documentElement.clientHeight&&(a&&clearTimeout(a),a=setTimeout(function(){m()},50),b=document.documentElement.clientHeight)})}else $(window).resize(function(){a&&clearTimeout(a),a=setTimeout(function(){m()},50)})},o=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(a){a.preventDefault();var b=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen"),b.find(".portlet-title .fullscreen").tooltip("destroy"),b.find(".portlet-title > .tools > .reload").tooltip("destroy"),b.find(".portlet-title > .tools > .remove").tooltip("destroy"),b.find(".portlet-title > .tools > .config").tooltip("destroy"),b.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy"),b.remove()}),$("body").on("click",".portlet > .portlet-title .fullscreen",function(a){a.preventDefault();var b=$(this).closest(".portlet");if(b.hasClass("portlet-fullscreen"))$(this).removeClass("on"),b.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height","auto");else{var c=Metronic.getViewPort().height-b.children(".portlet-title").outerHeight()-parseInt(b.children(".portlet-body").css("padding-top"))-parseInt(b.children(".portlet-body").css("padding-bottom"));$(this).addClass("on"),b.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height",c)}}),$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(a){a.preventDefault();var b=$(this).closest(".portlet").children(".portlet-body"),c=$(this).attr("data-url"),d=$(this).attr("data-error-display");c?(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:c,dataType:"html",success:function(a){Metronic.unblockUI(b),b.html(a)},error:function(a,c,e){Metronic.unblockUI(b);var f="Error on reloading the content. Please check your connection and try again.";"toastr"==d&&toastr?toastr.error(f):"notific8"==d&&$.notific8?($.notific8("zindex",11500),$.notific8(f,{theme:"ruby",life:3e3})):alert(f)}})):(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),window.setTimeout(function(){Metronic.unblockUI(b)},1e3))}),$('.portlet .portlet-title a.reload[data-load="true"]').click(),$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(a){a.preventDefault()})},p=function(){if($().uniform){var a=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");a.size()>0&&a.each(function(){0===$(this).parents(".checker").size()&&$(this).show()})}},q=function(){$().iCheck&&$(".icheck").each(function(){var a=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",b=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";a.indexOf("_line")>-1||b.indexOf("_line")>-1?$(this).iCheck({checkboxClass:a,radioClass:b,insert:'<div class="icheck_line-icon"></div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:a,radioClass:b})})},r=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},s=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},t=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(a){Metronic.scrollTo($(a.target))})},u=function(){if(location.hash){var a=location.hash.substr(1);$('a[href="#'+a+'"]').parents(".tab-pane:hidden").each(function(){var a=$(this).attr("id");$('a[href="#'+a+'"]').click()}),$('a[href="#'+a+'"]').click()}},v=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")}),$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")}),$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")}),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip(),$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"}),$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"}),$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"}),$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"}),$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"
-})},x=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(a){a.stopPropagation()})},y=function(){$("body").on("click",'[data-close="alert"]',function(a){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-close="note"]',function(a){$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-remove="note"]',function(a){$(this).closest(".note").remove(),a.preventDefault()})},z=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")})},A=function(){$(".popovers").popover(),$(document).on("click.bs.popover.data-api",function(b){a&&a.popover("hide")})},B=function(){Metronic.initSlimScroll(".scroller")},C=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},D=function(){(c||d)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var a=$(this);""===a.val()&&""!==a.attr("placeholder")&&a.addClass("placeholder").val(a.attr("placeholder")),a.focus(function(){a.val()==a.attr("placeholder")&&a.val("")}),a.blur(function(){(""===a.val()||a.val()==a.attr("placeholder"))&&a.val(a.attr("placeholder"))})})},E=function(){$().select2&&$(".select2me").select2({placeholder:"Select"})};return{init:function(){l(),n(),p(),q(),r(),B(),C(),E(),o(),y(),x(),u(),w(),A(),t(),v(),s(),D()},initAjax:function(){p(),q(),r(),z(),B(),E(),C(),x(),w(),A(),t(),s()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(b){a=b},addResizeHandler:function(a){f.push(a)},runResizeHandlers:function(){m()},scrollTo:function(a,b){var c=a&&a.size()>0?a.offset().top:0;a&&($("body").hasClass("page-header-fixed")&&(c-=$(".page-header").height()),c+=b?b:-1*a.height()),$("html,body").animate({scrollTop:c},"slow")},initSlimScroll:function(a){$(a).each(function(){if(!$(this).attr("data-initialized")){var a;a=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height"),$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:b?"left":"right",height:a,alwaysVisible:"1"==$(this).attr("data-always-visible")?!0:!1,railVisible:"1"==$(this).attr("data-rail-visible")?!0:!1,disableFadeOut:!0}),$(this).attr("data-initialized","1")}})},destroySlimScroll:function(a){$(a).each(function(){if("1"===$(this).attr("data-initialized")){$(this).removeAttr("data-initialized"),$(this).removeAttr("style");var a={};$(this).attr("data-handle-color")&&(a["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(a["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(a["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(a["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(a["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0});var b=$(this);$.each(a,function(a,c){b.attr(a,c)})}})},scrollTop:function(){Metronic.scrollTo()},blockUI:function(a){a=$.extend(!0,{},a);var b="";if(b=a.animate?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>':a.iconOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""></div>':a.textOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>":'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>",a.target){var c=$(a.target);c.height()<=$(window).height()&&(a.cenrerY=!0),c.block({message:b,baseZ:a.zIndex?a.zIndex:1e3,centerY:void 0!==a.cenrerY?a.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})}else $.blockUI({message:b,baseZ:a.zIndex?a.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(a){a?$(a).unblock({onUnblock:function(){$(a).css("position",""),$(a).css("zoom","")}}):$.unblockUI()},startPageLoading:function(a){a&&a.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif"/>&nbsp;&nbsp;<span>'+(a&&a.message?a.message:"Loading...")+"</span></div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(a){a=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},a);var b=Metronic.getUniqueID("Metronic_alert"),c='<div id="'+b+'" class="Metronic-alerts alert alert-'+a.type+' fade in">'+(a.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>':"")+(""!==a.icon?'<i class="fa-lg fa fa-'+a.icon+'"></i>  ':"")+a.message+"</div>";return a.reset&&$(".Metronic-alerts").remove(),a.container?"append"==a.place?$(a.container).append(c):$(a.container).prepend(c):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(c):$(".page-bar").size()>0?$(".page-bar").after(c):$(".page-breadcrumb").after(c),a.focus&&Metronic.scrollTo($("#"+b)),a.closeInSeconds>0&&setTimeout(function(){$("#"+b).remove()},1e3*a.closeInSeconds),b},initUniform:function(a){a?$(a).each(function(){0===$(this).parents(".checker").size()&&($(this).show(),$(this).uniform())}):p()},updateUniform:function(a){$.uniform.update(a)},initFancybox:function(){C()},getActualVal:function(a){return a=$(a),a.val()===a.attr("placeholder")?"":a.val()},getURLParameter:function(a){var b,c,d=window.location.search.substring(1),e=d.split("&");for(b=0;b<e.length;b++)if(c=e[b].split("="),c[0]==a)return unescape(c[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(a){return!1}},getViewPort:function(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}},getUniqueID:function(a){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return c},isIE9:function(){return d},isRTL:function(){return b},isAngularJsApp:function(){return"undefined"==typeof angular?!1:!0},getAssetsPath:function(){return g},setAssetsPath:function(a){g=a},setGlobalImgPath:function(a){h=a},getGlobalImgPath:function(){return g+h},setGlobalPluginsPath:function(a){i=a},getGlobalPluginsPath:function(){return g+i},getGlobalCssPath:function(){return g+j},getBrandColor:function(a){return k[a]?k[a]:""},getResponsiveBreakpoint:function(a){var b={xs:480,sm:768,md:900,lg:1200};return b[a]?b[a]:0}}}(),Layout=function(){var a="img/",b="css/",c=Metronic.getResponsiveBreakpoint("md"),d=function(){var a,b=$(".page-content"),d=$(".page-sidebar"),e=$("body");if(e.hasClass("page-footer-fixed")===!0&&e.hasClass("page-sidebar-fixed")===!1){var f=Metronic.getViewPort().height-$(".page-footer").outerHeight()-$(".page-header").outerHeight();b.height()<f&&b.attr("style","min-height:"+f+"px")}else{if(e.hasClass("page-sidebar-fixed"))a=g(),e.hasClass("page-footer-fixed")===!1&&(a-=$(".page-footer").outerHeight());else{var h=$(".page-header").outerHeight(),i=$(".page-footer").outerHeight();a=Metronic.getViewPort().width<c?Metronic.getViewPort().height-h-i:d.height()+20,a+h+i<=Metronic.getViewPort().height&&(a=Metronic.getViewPort().height-h-i)}b.attr("style","min-height:"+a+"px")}},e=function(a,b){var d=location.hash.toLowerCase(),e=$(".page-sidebar-menu");if("click"===a||"set"===a?b=$(b):"match"===a&&e.find("li > a").each(function(){var a=$(this).attr("href").toLowerCase();return a.length>1&&d.substr(1,a.length-1)==a.substr(1)?void(b=$(this)):void 0}),b&&0!=b.size()&&"javascript:;"!==b.attr("href").toLowerCase()&&"#"!==b.attr("href").toLowerCase()){parseInt(e.data("slide-speed")),e.data("keep-expanded");e.find("li.active").removeClass("active"),e.find("li > a > .selected").remove(),e.hasClass("page-sidebar-menu-hover-submenu")===!1?e.find("li.open").each(function(){0===$(this).children(".sub-menu").size()&&($(this).removeClass("open"),$(this).find("> a > .arrow.open").removeClass("open"))}):e.find("li.open").removeClass("open"),b.parents("li").each(function(){$(this).addClass("active"),$(this).find("> a > span.arrow").addClass("open"),1===$(this).parent("ul.page-sidebar-menu").size()&&$(this).find("> a").append('<span class="selected"></span>'),1===$(this).children("ul.sub-menu").size()&&$(this).addClass("open")}),"click"===a&&Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click()}},f=function(){jQuery(".page-sidebar").on("click","li > a",function(a){var b=$(this).next().hasClass("sub-menu");if(!(Metronic.getViewPort().width>=c&&1===$(this).parents(".page-sidebar-menu-hover-submenu").size())){if(b===!1)return void(Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click());if(!$(this).next().hasClass("sub-menu always-open")){var e=$(this).parent().parent(),f=$(this),g=$(".page-sidebar-menu"),h=jQuery(this).next(),i=g.data("auto-scroll"),j=parseInt(g.data("slide-speed")),k=g.data("keep-expanded");k!==!0&&(e.children("li.open").children("a").children(".arrow").removeClass("open"),e.children("li.open").children(".sub-menu:not(.always-open)").slideUp(j),e.children("li.open").removeClass("open"));var l=-200;h.is(":visible")?(jQuery(".arrow",jQuery(this)).removeClass("open"),jQuery(this).parent().removeClass("open"),h.slideUp(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})):b&&(jQuery(".arrow",jQuery(this)).addClass("open"),jQuery(this).parent().addClass("open"),h.slideDown(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})),a.preventDefault()}}}),jQuery(".page-sidebar").on("click"," li > a.ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=jQuery(".page-sidebar ul"),e=($(".page-content"),$(".page-content .page-content-body"));d.children("li.active").removeClass("active"),d.children("arrow.open").removeClass("open"),$(this).parents("li").each(function(){$(this).addClass("active"),$(this).children("a > span.arrow").addClass("open")}),$(this).parents("li").addClass("active"),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),Metronic.startPageLoading();var f=$(this);$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){0===f.parents("li.open").size()&&$(".page-sidebar-menu > li.open > a").click(),Metronic.stopPageLoading(),e.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){Metronic.stopPageLoading(),e.html("<h4>Could not load the requested content.</h4>")}})}),jQuery(".page-content").on("click",".ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=($(".page-content"),$(".page-content .page-content-body"));Metronic.startPageLoading(),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){Metronic.stopPageLoading(),d.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){d.html("<h4>Could not load the requested content.</h4>"),Metronic.stopPageLoading()}})}),i(),$(".page-sidebar").on("click",".sidebar-search .remove",function(a){a.preventDefault(),$(".sidebar-search").removeClass("open")}),$(".page-sidebar .sidebar-search").on("keypress","input.form-control",function(a){return 13==a.which?($(".sidebar-search").submit(),!1):void 0}),0!==$(".sidebar-search").size()&&($(".sidebar-search .input-group").on("click",function(a){a.stopPropagation()}),$("body").on("click",function(){$(".sidebar-search").hasClass("open")&&$(".sidebar-search").removeClass("open")}))},g=function(){var a=Metronic.getViewPort().height-$(".page-header").outerHeight();return $("body").hasClass("page-footer-fixed")&&(a-=$(".page-footer").outerHeight()),a},h=function(){var a=$(".page-sidebar-menu");return Metronic.destroySlimScroll(a),0===$(".page-sidebar-fixed").size()?void d():void(Metronic.getViewPort().width>=c&&(a.attr("data-height",g()),Metronic.initSlimScroll(a),d()))},i=function(){var a=$("body");a.hasClass("page-sidebar-fixed")&&$(".page-sidebar").on("mouseenter",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").removeClass("page-sidebar-menu-closed")}).on("mouseleave",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").addClass("page-sidebar-menu-closed")})},j=function(){$("body");$.cookie&&"1"===$.cookie("sidebar_closed")&&Metronic.getViewPort().width>=c?($("body").addClass("page-sidebar-closed"),$(".page-sidebar-menu").addClass("page-sidebar-menu-closed")):$.cookie&&$.cookie("sidebar_closed","0")},k=function(){$(".page-header").on("click",'.hor-menu a[data-toggle="tab"]',function(a){a.preventDefault();var b=$(".hor-menu .nav"),c=b.find("li.current");$("li.active",c).removeClass("active"),$(".selected",c).remove();var d=$(this).parents("li").last();d.addClass("current"),d.find("a:first").append('<span class="selected"></span>')}),$(".page-header").on("click",".search-form",function(a){$(this).addClass("open"),$(this).find(".form-control").focus(),$(".page-header .search-form .form-control").on("blur",function(a){$(this).closest(".search-form").removeClass("open"),$(this).unbind("blur")})}),$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(a){return 13==a.which?($(this).closest(".search-form").submit(),!1):void 0}),$(".page-header").on("mousedown",".search-form.open .submit",function(a){a.preventDefault(),a.stopPropagation(),$(this).closest(".search-form").submit()}),$('[data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")}),$(document).on("click",".mega-menu-dropdown .dropdown-menu",function(a){a.stopPropagation()})},l=function(){$("body").on("shown.bs.tab",'a[data-toggle="tab"]',function(){d()})},m=function(){var a=300,b=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(c){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}):$(window).scroll(function(){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}),$(".scroll-to-top").click(function(a){return a.preventDefault(),$("html, body").animate({scrollTop:0},b),!1})},n=function(){var a,b=$(".full-height-content");if(a=Metronic.getViewPort().height-$(".page-header").outerHeight(!0)-$(".page-footer").outerHeight(!0)-$(".page-title").outerHeight(!0)-$(".page-bar").outerHeight(!0),b.hasClass("portlet")){var d=b.find(".portlet-body");if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(d.find(".full-height-content-body"));a=a-b.find(".portlet-title").outerHeight(!0)-parseInt(b.find(".portlet-body").css("padding-top"))-parseInt(b.find(".portlet-body").css("padding-bottom"))-2,b.hasClass("full-height-content-scrollable")?(a-=35,d.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(d.find(".full-height-content-body"))):d.css("min-height",a)}else{if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(b.find(".full-height-content-body"));b.hasClass("full-height-content-scrollable")?(a-=35,b.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(b.find(".full-height-content-body"))):b.css("min-height",a)}};return{initHeader:function(){k()},setSidebarMenuActiveLink:function(a,b){e(a,b)},initSidebar:function(){h(),f(),j(),Metronic.isAngularJsApp()&&e("match"),Metronic.addResizeHandler(h)},initContent:function(){n(),l(),Metronic.addResizeHandler(d),Metronic.addResizeHandler(n)},initFooter:function(){m()},init:function(){this.initHeader(),this.initSidebar(),this.initContent(),this.initFooter()},fixContentHeight:function(){d()},initFixedSidebarHoverEffect:function(){i()},initFixedSidebar:function(){h()},getLayoutImgPath:function(){return Metronic.getAssetsPath()+a},getLayoutCssPath:function(){return Metronic.getAssetsPath()+b}}}();angular.module("xCallyShuttleApp").run(["$templateCache",function(a){a.put("app/analytic/extracted/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n        <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="fa fa-file-pdf-o"></i>\n                                      <a href="/analytics/extracted/list">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a>\n                           </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="fa fa-file-pdf-o font-green-sharp"></i>\n                                     <span class="caption-subject">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a> </span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                        <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                  <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                              </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.metric.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-calculator"></i>\n                                       <a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <!-- <div class="portlet-title">\n                              <div class="caption font-green-sharp">\n                                        <i class="icon-calculator font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_DEFAULT_METRICS\' | translate }}</a> </span>\n                           </div>\n                                <div class="actions">\n                         </div>\n                        </div> -->\n                    <!-- <div class="portlet-body"> -->\n                           <!-- START TABLE -->\n                          <!-- <div ui-grid="gridOptionsDefault" data-ng-if="gridOptionsDefault" name="gridOptionsDefault"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                    <div class="watermark" ng-show="!gridOptionsDefault.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                               </div> -->\n                            <!-- END TABLE -->\n                    <!-- </div> -->\n                       <div class="portlet-title"><!-- removed margin-top20 class from title when commented the default metrics section-->\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-calculator font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_METRICS\' | translate }}</a> </span>\n                           </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                        <div class="btn-group">\n                                               <button class="btn green-jungle " ng-click="create()">\n                                                        <i class="icon-plus"></i> {{ \'APPLICATION_NEW_METRIC\' | translate }}\n                                                </button>\n                                     </div>\n                                        <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions" data-ng-if="gridOptions" name="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                       <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                              </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/view.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}</label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required readonly/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}</label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required data-ng-disabled="true">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}</label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required readonly/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description" readonly></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMetric()">\n  <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-eye"></i>\n                                      <a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n                                       <i data-ng-show="metric" class="fa fa-angle-right"></i>\n                               </li>\n                         <li data-ng-show="metric">\n                                    <a href="#">{{metric.name}}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET MAIN -->\n                 <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/metric.png" class="img-responsive">\n                             </div>\n                                <!-- END SIDEBAR USERPIC -->\n                          <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{metric.name}}\n                                       </div>\n                                        <!-- <div class="profile-usertitle-job">\n                                              {{user.role}}\n                                 </div> -->\n                            </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.analytics.metrics.view.settings\')}">\n                                                    <a data-ng-href="/analytics/metrics/view/{{metric.id}}/settings">\n                                                     <i class="icon-settings"></i>\n                                                 {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n                                                </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET MAIN -->\n             </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view class="profile-content">\n         </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.settings.html",'<div class="row">\n   <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_METRIC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n                              </div>\n                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\n\n                      <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- GENERAL TAB -->\n                                  <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.general" data-ng-submit="forms.general.$valid && updateMetric()" novalidate>\n\n                                                      <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="metric.name" required/>\n                                                         <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END NAME -->\n\n                                                   <!-- START TABLE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="metric.table" name="table" theme="bootstrap" required>\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n                                                                  <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n                                                                          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TABLE-->\n\n                                                   <!-- START METRIC -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="metric.metric" required/></textarea>\n                                                             <span data-ng-show="(forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END METRIC -->\n\n                                                 <!-- START DESCRIPTION -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                                              <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n                                                        </div>\n                                                        <!-- END DESCRIPTION -->\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ADVANCED TAB -->\n\n                           </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
+b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var l,m;return l=c.contents().remove(),function(c,n){c.randomName=f(),d(function(){return e.get({active:1}).$promise.then(function(a){_.remove(a.rows,function(a){return"iframe"===a.state}),c.integrations=a.rows,c.element.data1&&o()})["catch"](function(a){b.error(a)})});var o=function(){var a;switch(c.element.data1){case"zendesk":a=g;break;case"desk":a=h;break;case"salesforce":a=i;break;case"freshdesk":a=j;break;case"sugarcrm":a=k}return a?a.get().$promise.then(function(a){c.accounts=a.rows,c.element.data2&&p()})["catch"](function(a){b.error(a)}):void 0},p=function(){c.configurations=_.find(c.accounts,{id:Number(c.element.data2)}).Configurations};c.changeIntegration=function(){c.element.data2="",o()},c.changeAccount=function(){c.element.data3="",p()},m||(m=a(l)),n.append(m(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderJscripty",["$compile","xAlert","$http","$timeout","Template","$translate","JscriptyProject",function(a,b,c,d,e,f,g){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/jscripty/actionBuilder.html",compile:function(c){var e,f;return e=c.contents().remove(),function(c,h){function i(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=i(),d(function(){return g.get().$promise.then(function(a){console.log(a),c.projects=a.rows})["catch"](function(a){b.error(a)})}),f||(f=a(e)),h.append(f(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderMotionBar",["$compile","xAlert","$http","$timeout","Template",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/motionbar/actionBuilder.html",compile:function(c){var f,g;return f=c.contents().remove(),function(c,h){function i(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.error(a)})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}c.randomName=j(),c.motionActions=[{name:"Popup",value:"0"},{name:"URL",value:"1"},{name:"Windows App",value:"2"}],c.changeMode=function(){c.element.data2="",c.element.data3="",i()},d(function(){return i()}),g||(g=a(f)),h.append(g(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderStatus",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/status/actionBuilder.html",compile:function(b){var c,d;return c=b.contents().remove(),function(b,e){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}b.randomName=f(),b.states=[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],d||(d=a(c)),e.append(d(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderTag",["$compile","xAlert","$http","$timeout","Tag",function(a,b,c,d,e){return{restrict:"E",scope:{myElement:"=element",form:"="},templateUrl:"components/directives/action/tag/actionBuilder.html",compile:function(c){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var g,h;return g=c.contents().remove(),function(c,i){console.log("myElement",c.myElement),c.randomName=f(),c.data={tags:c.myElement.data1?c.myElement.data1.split(";"):[]},c.$watch("data.tags",function(a){c.myElement.data1=a.join(";")}),d(function(){return e.get().$promise.then(function(a){c.tags=a.rows})["catch"](function(a){b.error(a)})}),h||(h=a(g)),i.append(h(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderTemplate",["$compile","xAlert","$http","$timeout","Template",function(a,b,c,d,e){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/template/actionBuilder.html",compile:function(c){function f(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var g,h;return g=c.contents().remove(),function(c,i){c.randomName=f(),d(function(){return e.get().$promise.then(function(a){c.templates=a.rows})["catch"](function(a){b.error(a)})}),h||(h=a(g)),i.append(h(c,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("actionBuilderUrlForward",["$compile",function(a){return{restrict:"E",scope:{element:"=",form:"="},templateUrl:"components/directives/action/urlforward/actionBuilder.html",compile:function(b){function c(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}var d,e;return d=b.contents().remove(),function(b,f){b.randomName=c(),b.types=[{name:"HTTP GET",value:"GET"},{name:"HTTP POST",value:"POST"}],e||(e=a(d)),f.append(e(b,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").directive("conditionBuilder",["$compile","$timeout","$translate","xAlert",function(a,b,c,d){return{restrict:"E",scope:{element:"=",serviceindex:"=",service:"=",form:"="},templateUrl:"components/directives/condition/conditionBuilder.html",compile:function(e){var f,g;return f=e.contents().remove(),function(e,h){function i(a){var b=_.find(e.service.services[e.serviceindex].conditions,{value:a});if(b)if(e.elementType=b.type,b.arr)e.values=b.arr;else if(b.resource)return b.resource.get(b.params||{}).$promise.then(function(a){e.values=_.map(a.rows,function(a){return{name:a[b.resName||b.resValue],value:a[b.resValue]}})})["catch"](function(a){d.show(c.instant(a.message),"danger")})}function j(a,b){var c=[];for(a=a||5,b=b||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";--a;)c.push(b.charAt(Math.floor(Math.random()*b.length)));return c.join("")}e._=_,e.randomName=j(),b(function(){e.element.field&&i(e.element.field)}),e.checkCondition=function(a){e.element.value="",e.element.operator="",i(a)},g||(g=a(f)),h.append(g(e,function(a){return a}))}}}}]),angular.module("xCallyShuttleApp").factory("xNotificationLicense",["Notification","$rootScope","$location",function(a,b,c){return{show:function(d){var e=b.$new();return e["class"]="alert-warning",e.icon="fa fa-exclamation-triangle",e.more=function(){c.path("/setting/license/view")},new a({delay:d,templateUrl:"components/factories/xNotificationLicense/xNotificationLicense.html",scope:e})}}}]),angular.module("xCallyShuttleApp").filter("secToTime",[function(){return function(a){return new Date(1970,0,1).setSeconds(a)}}]),angular.module("xCallyShuttleApp").controller("FooterController",["$scope","Setting",function(a,b){a.year=moment().year(),a.$on("$includeContentLoaded",function(){Layout.initFooter()}),a.initFooter=function(){return b.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("HeaderController",["$scope","$rootScope","$location","$state","$http","$interval","$notification","Auth","xAlert","socket","xNotificationLicense","toastr","localStorageService","Agent","SmsReport","MailReport","OpenChannelReport","ChatReport","ChatRoom","xNotification","$timeout","$translate","$window","User","Pause","Action","FaxReport","List","MailAccount","ChatWebsite","FaxAccount","SmsAccount","OpenChannelAccount","ReportAgent","$uibModal","$log","ReportDial",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K){function L(a,b,c){return null===b&&(b=50),null===c&&(c="..."),a&&a.length>b?a.substring(0,b-c.length)+c:a}function M(b){var c,d="reason";switch(b){case"mail":c=p;break;case"chat":c=r;break;case"fax":c=A;break;case"sms":c=o;break;case"agent":c=H,d="lastevent";break;case"dial":c=K,d="dialstatus";break;case"openchannel":c=q;break;default:return}return c.get({limit:10,order:"updatedAt DESC"}).$promise.then(function(c){_.forEach(c.rows,function(a){if(a[d])switch(a[d].toLowerCase()){case"answer":case"connect":case"complete":a.status="taken";break;case"answered_elsewhere":a.status="taken_elsewhere";break;case"called":a.status="lost";break;case"busy":a.status="busy";break;case"rejected":a.status="rejected";break;case"cancel":case"abandoned":a.status="abandoned"}}),a.agentNotifications[b].rows=c.rows,j.socket.on("report_"+b+":save",function(c){c.status="none",a.agentNotifications[b].rows.unshift(c),"agent"!==b&&"dial"!==b&&(a.agentNotifications[b].timeout[c.id]=setTimeout(function(){clearTimeout(a.agentNotifications[b].timeout[c.id]),_.find(a.agentNotifications[b].rows,{id:c.id}).status="lost",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++,delete a.agentNotifications[b].timeout[c.id]},1e3*c.timeslot))}),j.socket.on("report_"+b+":update",function(c){if("agent"===b){var e=_.find(a.activeCalls,{id:c.id});e&&(c.agentcomplete||c.agentringnoanswer||c.agentdump)?_.remove(a.activeCalls,{id:c.id}):!c.agentconnectAt||c.agentcomplete||c.agentringnoanswer||c.agentdump||a.activeCalls.push(c)}var f=_.find(a.agentNotifications[b].rows,{id:c.id});if(f&&("agent"!==b&&"dial"!==b&&a.agentNotifications[b].timeout[c.id]&&(clearTimeout(a.agentNotifications[b].timeout[c.id]),delete a.agentNotifications[b].timeout[c.id]),c[d])){switch(c[d].toLowerCase()){case"answer":case"connect":case"complete":c.status="taken";break;case"answered_elsewhere":c.status="taken_elsewhere",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications.chat["new"]++;break;case"busy":c.status="busy",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++;break;case"rejected":c.status="rejected";break;case"cancel":case"abandoned":c.status="abandoned",angular.element(document.getElementById("header_"+b+"_notification_bar")).hasClass("open")||a.agentNotifications[b]["new"]++}_.merge(f,c)}})})["catch"](function(a){i.error(a)})}function N(){return a.headerAgent=h.getCurrentUser(),a.readyTimer=1e3*moment().unix(),y.get().$promise.then(function(b){a.headerPauses=b.rows,j.syncUpdates("pause",a.headerPauses)})["finally"](function(){j.socket.on("agent:save",function(b){a.headerAgent.id===b.id&&(_.merge(a.headerAgent,b),b.voicePause&&b.mailPause&&b.chatPause&&b.faxPause&&b.smsPause&&b.openchannelPause||(a.readyTimer=1e3*moment().unix()))})})["catch"](function(a){console.log("Error synchronizing agent status:",a)})}function O(){return H.get({id:"active",controller:"calls"}).$promise.then(function(b){a.activeCalls=b.rows})["catch"](function(a){i.error(a)})}a.moment=moment,$(document).on("click",".tabbed-dropdown",function(a){a.stopPropagation()}),a.license.token!==a.license.token2&&(h.isAdmin()||h.isUser())&&f(function(){"main.setting.license.view"!==d.current.name&&k.show(3e4)},3e4),a.openRoom=function(b,c){var d=_.find(a.workspaces,{id:b,type:c});if(d)d.active=!0;else{var e;switch(c){case"mailRoom":e="icon-envelope";break;case"chatRoom":e="fa fa-users";break;case"faxRoom":e="icon-paper-plane";break;case"smsRoom":e="glyphicon glyphicon-comment";break;case"openchannelRoom":e="icon-globe"}a.workspaces.push({id:b,type:c,"class":e,active:!0})}},a.toggleSidebar=function(){b.settings.layout.pageSidebarClosed=!b.settings.layout.pageSidebarClosed,m.set("sidebarClosed",b.settings.layout.pageSidebarClosed)},a.chooseContact=function(b){var c=I.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{data:function(){return{type:"detail",phone:b,mobile:b}}}});c.result.then(function(c){c?a.openContactTab(c):a.newContact({calleridnum:b})},function(){J.info("Modal dismissed at: "+new Date)})},a.loadNotifications=function(b){if(!a.busyLoad[b].end){a.busyLoad[b].busy=!0;var c,d="reason";switch(b){case"mail":c=p;break;case"chat":c=r;break;case"fax":c=A;break;case"sms":c=o;break;case"agent":c=H,d="lastevent";break;case"dial":c=K,d="dialstatus";break;case"openchannel":c=q;break;default:return}return c.get({limit:10,offset:a.agentNotifications[b].rows.length,order:"updatedAt DESC"}).$promise.then(function(c){c.rows.length?(_.forEach(c.rows,function(a){if(a[d])switch(a[d].toLowerCase()){case"answer":case"connect":case"complete":a.status="taken";break;case"answered_elsewhere":a.status="taken_elsewhere";break;case"called":a.status="lost";break;case"busy":a.status="busy";break;case"rejected":a.status="rejected";break;case"abandoned":a.status="abandoned"}}),a.agentNotifications[b].rows=a.agentNotifications[b].rows.concat(c.rows)):a.busyLoad[b].end=!0,a.busyLoad[b].busy=!1})["catch"](function(a){i.error(a)})}},a.headerPause=function(b,c,d){return z.save({name:b,agent:a.headerAgent.id,type:c||"DEFAULT PAUSE",data4:c||"DEFAULT PAUSE",channel:d||"all"}).$promise.then(function(){i.show(v.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){i.error(a)})},"agent"===h.getCurrentUser().role&&(N(),a.agentNotifications={mail:{rows:[],"new":0,timeout:{}},chat:{rows:[],"new":0,timeout:{}},fax:{rows:[],"new":0,timeout:{}},sms:{rows:[],"new":0,timeout:{}},agent:{rows:[],"new":0},dial:{rows:[],"new":0},openchannel:{rows:[],"new":0}},a.busyLoad={mail:{busy:!1,end:!1},chat:{busy:!1,end:!1},fax:{busy:!1,end:!1},sms:{busy:!1,end:!1},agent:{busy:!1,end:!1},dial:{busy:!1,end:!1},openchannel:{busy:!1,end:!1}},O(),M("agent"),M("dial"),a.license.mail&&M("mail"),a.license.chat&&M("chat"),a.license.fax&&M("fax"),a.license.messaging&&M("sms"),a.license.openchannel&&M("openchannel")),j.socket.on("user_has_chat_room:save",function(b){var c;return s.get({id:Number(b.ChatRoomId)}).$promise.then(function(b){console.log("chatRoom",b),c=b;var d=_.find(a.workspaces,{id:Number(c.id),type:"chatRoom"});d?d.name=a.getFullnames(c):a.workspaces.push({id:c.id,name:a.getFullnames(c),type:"chatRoom","class":"icon-bubble",unread:1})})["catch"](function(a){console.error(a)})}),j.socket.on("chat_message:save",function(b){var c;if(b.UserId!==h.getCurrentUser().id){var d=_.find(a.workspaces,{id:Number(b.ChatRoomId),type:"chatRoom"});if(!d)return s.get({id:Number(b.ChatRoomId)}).$promise.then(function(b){c=b,a.workspaces.push({id:c.id,name:a.getFullnames(b),type:"chatRoom","class":"icon-bubble",unread:1})})["catch"](function(a){console.error(a)})}});var P=function(){return w.Notification},Q=function(){b.settings.layout.onFocus=!0},R=function(){b.settings.layout.onFocus=!1};w.onfocus=Q,w.onblur=R,a.getFullnames=function(a){var b=_.map(a.Users,"fullname");return a.ChatVisitor&&b.unshift(a.ChatVisitor.fullname),_.without(b,h.getCurrentUser().fullname).join(", ")},a.openContact=function(b,c,d){if(d&&"<unknown>"!==d){var e,f;switch(b){case"mail":e=C,f={email:d};break;case"chat":e=D,f={email:d};break;case"fax":e=E,f={fax:d};break;case"sms":e=F,f={mobile:d};break;default:return}return e.get({id:c}).$promise.then(function(a){return a.ListId?B.save({listId:a.ListId,controller:"contacts"},f).$promise:null}).then(function(b){if(b){var c=_.find(a.workspaces,{contactID:b.id});c?c.active=!0:a.workspaces.push({active:!0,"class":"icon-user",contactID:b.id,name:b.email,type:"contact"})}else i.show(v.instant("MESSAGE_NO_LIST_CONFIGURED"),"info")})["catch"](function(a){console.error(a)})}},a.initHeader=function(){"agent"===h.getCurrentUser().role&&(j.socket.on("report_chat:save",function(a){P&&!b.settings.layout.onFocus&&g("CHAT CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Chat Visitor!",delay:1e3*a.timeslot});var c="<b>"+v.instant("APPLICATION_FROM")+"</b>: "+a.visitorname+"<br><b>"+v.instant("APPLICATION_EMAIL")+"</b>: "+a.visitoremail;"queue"===a.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+a.queuename),t.show(v.instant("APPLICATION_NEW_CHAT_REQUEST"),c,"chat",1e3*a.timeslot,function(){return r.get({id:a.id,controller1:"accept",controller2:a.uniqueid}).$promise.then(function(){i.show("Chat properly assigned","success")})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_CHAT_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return r.get({id:a.id,controller1:"reject"}).$promise.then(function(){i.show("Chat properly rejected","success")})["catch"](function(a){i.error(a)})})}),j.socket.on("report_mail:save",function(c){var d=_.find(a.workspaces,{id:c.roomid,type:"mailRoom"});if(!d){var e="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+c.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+c.from+"<br> <b>"+v.instant("APPLICATION_SUBJECT")+"</b>: "+(L(c.subject,30,"...")||"No subject");"queue"===c.application&&(e+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+c.queuename),t.show(v.instant("APPLICATION_NEW_MAIL_REQUEST"),e,"mail",1e3*c.timeslot,function(){return p.get({id:c.id,controller1:"accept",controller2:c.uniqueid}).$promise.then(function(){var b=_.find(a.workspaces,{id:c.roomid,type:"mailRoom"});b?b.active=!0:a.workspaces.push({id:c.roomid,name:c.subject||"No subject",type:"mailRoom","class":"icon-envelope",active:!0,unread:0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_MAIL_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return p.get({id:c.id,controller1:"reject"}).$promise["catch"](function(a){i.error(a)})}),P&&!b.settings.layout.onFocus?g("MAIL CHANNEL",{icon:"assets/images/media/channels/mail64.png",body:"NEW Incoming Mail Message!",delay:1e3*c.timeslot}):console.log("Notification API not supported in your browser")}}),j.socket.on("report_sms:save",function(b){var c="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+b.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+b.from;"queue"===b.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+b.queuename),t.show(v.instant("APPLICATION_NEW_SMS_REQUEST"),c,"sms",1e3*b.timeslot,function(){return o.get({id:b.id,controller1:"accept",controller2:b.uniqueid}).$promise.then(function(){var c=_.find(a.workspaces,{id:b.roomid,type:"smsRoom"});c?c.active=!0:a.workspaces.push({id:b.roomid,name:b.from,type:"smsRoom","class":"glyphicon glyphicon-comment",active:!0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_SMS_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return o.get({id:b.id,controller1:"reject"}).$promise.then(function(){i.show("SMS properly rejected","success")})["catch"](function(a){i.error(a)})}),P?g("SMS CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming SMS Message!",delay:1e3*b.timeslot}):console.log("Notification API not supported in your browser")}),j.socket.on("report_openchannel:save",function(b){var c="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+b.accountname+"<br> <b>"+v.instant("APPLICATION_FROM")+"</b>: "+b.from;"queue"===b.application&&(c+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+b.queuename),t.show(v.instant("APPLICATION_NEW_MESSAGE"),c,"openchannel",1e3*b.timeslot,function(){return q.get({id:b.id,controller1:"accept",controller2:b.uniqueid}).$promise.then(function(){var c=_.find(a.workspaces,{id:b.roomid,type:"openchannelRoom"});c?c.active=!0:a.workspaces.push({id:b.roomid,name:b.from,type:"openchannelRoom","class":"icon-globe",active:!0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return q.get({id:b.id,controller1:"reject"}).$promise.then(function(){i.show("Message properly rejected","success")})["catch"](function(a){i.error(a)})}),P?g("OPEN CHANNEL",{icon:"assets/images/media/channels/chat64.png",body:"NEW Incoming Message!",delay:1e3*b.timeslot}):console.log("Notification API not supported in your browser")}),j.socket.on("report_fax:save",function(c){var d=_.find(a.workspaces,{id:c.roomid,type:"faxRoom"});if(!d){var e="<b>"+v.instant("APPLICATION_ACCOUNT")+"</b>: "+c.accountname+"<br>               <b>"+v.instant("APPLICATION_PHONE")+"</b>: "+c.from;"queue"===c.application&&(e+="<br><b>"+v.instant("APPLICATION_QUEUE")+"</b>: "+c.queuename),t.show(v.instant("APPLICATION_NEW_FAX_REQUEST"),e,"fax",1e3*c.timeslot,function(){return A.get({id:c.id,controller1:"accept",controller2:c.uniqueid}).$promise.then(function(){var b=_.find(a.workspaces,{id:c.roomid,type:"faxRoom"});b?b.active=!0:a.workspaces.push({id:c.roomid,name:c.from,type:"faxRoom","class":"icon-paper-plane",active:!0,unread:0})})["catch"](function(a){switch(a.status){case 504:i.show(v.instant("MESSAGE_FAX_ALREADY_MANAGED"),"info");break;default:i.error(a)}})},function(){return A.get({id:c.id,controller1:"reject"}).$promise["catch"](function(a){i.err(a)})}),P&&!b.settings.layout.onFocus?g("FAX CHANNEL",{icon:"assets/images/media/channels/telephone124.png",body:"NEW Incoming Fax Message!",delay:1e3*c.timeslot}):console.log("Notification API not supported in your browser")}}))},a.logout=function(){return e.get("/auth/local/logout").success(function(){h.logout(),c.path("/login")}).error(function(a){console.error(a)})},a.isActive=function(a){return a===c.path()},a.$on("$destroy",function(){console.log("header $destroy"),j.unsyncUpdates("pause"),j.unsyncUpdates("agent"),j.unsyncUpdates("report_chat"),j.unsyncUpdates("report_mail"),j.unsyncUpdates("report_fax"),j.unsyncUpdates("report_sms"),j.unsyncUpdates("report_openchannel"),j.unsyncUpdates("user_has_chat_room"),j.unsyncUpdates("chat_message")})}]),angular.module("xCallyShuttleApp").factory("Modal",["$rootScope","$uibModal",function(a,b){function c(c,d){var e=a.$new();return c=c||{},d=d||"modal-default",angular.extend(e,c),b.open({templateUrl:"components/modal/delete.html",windowClass:d,scope:e})}return{confirm:{"delete":function(a){return a=a||angular.noop,function(){var b,d=Array.prototype.slice.call(arguments),e=d.shift();b=c({modal:{dismissable:!0,title:"Confirm Delete",html:"<p>Are you sure you want to delete"+(e?"<strong> "+e+"</strong>":" selected items")+"?</p>",buttons:[{classes:"btn red",text:"Delete",click:function(a){b.close(a)}},{classes:"btn default",text:"Cancel",click:function(a){b.dismiss(a)}}]}},"over-topbar center"),b.result.then(function(b){a.apply(b,d)})}}}}}]),angular.module("xCallyShuttleApp").service("application",function(){var a={applications:[{type:null,name:"APPLICATION_QUEUE",value:"Queue"},{type:null,name:"APPLICATION_PLAYBACK",value:"Playback"},{type:null,name:"Dial",value:"Dial"},{type:"internalDial",name:"APPLICATION_INTERNAL_DIAL",value:"Dial"},{type:"externalDial",name:"APPLICATION_EXTERNAL_DIAL",value:"Dial"},{type:"RingGroup",name:"Ring Group",value:"Dial"},{type:null,name:"Cally-Square Project",value:"AGI"},{type:null,name:"GoTo",value:"Goto"},{type:null,name:"Hangup",value:"Hangup"},{type:null,name:"Set",value:"Set"},{type:"custom",name:"Custom",value:"custom"},{type:null,name:"APPLICATION_VOICEMAIL",value:"Voicemail"}],queueOptions:[{value:"C",name:"APPLICATION_QUEUE_OPTION_C"},{value:"c",name:"APPLICATION_QUEUE_OPTION_c"},{value:"d",name:"APPLICATION_QUEUE_OPTION_d"},{value:"F",name:"APPLICATION_QUEUE_OPTION_F"},{value:"h",name:"APPLICATION_QUEUE_OPTION_h"},{value:"H",name:"APPLICATION_QUEUE_OPTION_H"},{value:"n",name:"APPLICATION_QUEUE_OPTION_n"},{value:"i",name:"APPLICATION_QUEUE_OPTION_i"},{value:"I",name:"APPLICATION_QUEUE_OPTION_I"},{value:"r",name:"APPLICATION_QUEUE_OPTION_r"},{value:"R",name:"APPLICATION_QUEUE_OPTION_R"},{value:"t",name:"APPLICATION_QUEUE_OPTION_t"},{value:"T",name:"APPLICATION_QUEUE_OPTION_T"},{value:"w",name:"APPLICATION_QUEUE_OPTION_w"},{value:"W",name:"APPLICATION_QUEUE_OPTION_W"},{value:"k",name:"APPLICATION_QUEUE_OPTION_k"},{value:"K",name:"APPLICATION_QUEUE_OPTION_K"},{value:"x",name:"APPLICATION_QUEUE_OPTION_x"},{value:"X",name:"APPLICATION_QUEUE_OPTION_X"}],audioOptions:[{value:"skip",name:"APPLICATION_PLAYBACK_OPTION_SKIP"},{value:"noanswer",name:"APPLICATION_PLAYBACK_OPTION_NOANSWER"},{value:"j",name:"APPLICATION_PLAYBACK_OPTION_J"},{value:"say",name:"APPLICATION_PLAYBACK_OPTION_SAY"}],hangupCauses:[{value:"",name:"--"},{value:"1",name:"APPLICATION_HANGUP_CAUSE_1"},{value:"16",name:"APPLICATION_HANGUP_CAUSE_16"},{value:"17",name:"APPLICATION_HANGUP_CAUSE_17"},{value:"18",name:"APPLICATION_HANGUP_CAUSE_18"},{value:"21",name:"APPLICATION_HANGUP_CAUSE_21"},{value:"22",name:"APPLICATION_HANGUP_CAUSE_22"},{value:"27",name:"APPLICATION_HANGUP_CAUSE_27"},{value:"38",name:"APPLICATION_HANGUP_CAUSE_38"},{value:"41",name:"APPLICATION_HANGUP_CAUSE_41"}],intTypes:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"custom",name:"APPLICATION_CUSTOM"},{value:"list",name:"APPLICATION_FROM_LIST"}],checkUnderscore:function(a){return 0===a.indexOf("_")?a:"_"+a}};return{application:a}}),angular.module("xCallyShuttleApp").service("automations",function(){var a={mail:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},chat:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"},{name:"APPLICATION_STATUS_PENDING",value:"PENDING"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]},fax:{conditions:[{name:"APPLICATION_STATUS",value:"status",type:"select",arr:[{name:"APPLICATION_STATUS_NEW",value:"NEW"},{name:"APPLICATION_STATUS_OPEN",value:"OPEN"},{name:"APPLICATION_STATUS_CLOSED",value:"CLOSED"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_HOURS_SINCE_CREATED",value:"createdAt",type:"input",operators:[{value:"greater_or_equal",name:"APPLICATION_GTE_TO"},{value:"less_or_equal",name:"APPLICATION_LTE_TO"},{value:"greater",name:"APPLICATION_GREATER_THAN"},{value:"less",name:"APPLICATION_LESS_THAN"}]}],actions:[{name:"APPLICATION_STATUS",value:"status"}]}},b=["mail","fax","chat"];return{services:a,channels:b}}),angular.module("xCallyShuttleApp").service("channel",function(){var a=[{name:"Voice",value:"voice"}];return a}),angular.module("xCallyShuttleApp").service("desk_com",function(){var a=[{id:"priority",label:"Priority",custom:!1,data:{choices:[1,2,3,4,5,6,7,8,9,10]}},{id:"status",label:"Status",custom:!1,data:{choices:["new","open","pending","resolved","closed"]}},{id:"type",label:"Type",custom:!1,data:{choices:["chat","twitter","email","qna","facebook","phone"]}}];return{fields:a}}),angular.module("xCallyShuttleApp").service("interval",function(){var a={months:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"jan",name:"APPLICATION_JANUARY"},{value:"feb",name:"APPLICATION_FEBRUARY"},{value:"mar",name:"APPLICATION_MARCH"},{value:"apr",name:"APPLICATION_APRIL"},{value:"may",name:"APPLICATION_MAY"},{value:"jun",name:"APPLICATION_JUNE"},{value:"jul",name:"APPLICATION_JULY"},{value:"aug",name:"APPLICATION_AUGUST"},{value:"sep",name:"APPLICATION_SEPTEMBER"},{value:"oct",name:"APPLICATION_OCTOBER"},{value:"nov",name:"APPLICATION_NOVEMBER"},{value:"dec",name:"APPLICATION_DECEMBER"}],monthsNumber:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"1",name:"APPLICATION_JANUARY"},{value:"2",name:"APPLICATION_FEBRUARY"},{value:"3",name:"APPLICATION_MARCH"},{value:"4",name:"APPLICATION_APRIL"},{value:"5",name:"APPLICATION_MAY"},{value:"6",name:"APPLICATION_JUNE"},{value:"7",name:"APPLICATION_JULY"},{value:"8",name:"APPLICATION_AUGUST"},{value:"9",name:"APPLICATION_SEPTEMBER"},{value:"10",name:"APPLICATION_OCTOBER"},{value:"11",name:"APPLICATION_NOVEMBER"},{value:"12",name:"APPLICATION_DECEMBER"}],daysOfWeek:[{value:"always",name:"APPLICATION_ALWAYS"},{value:"mon",name:"APPLICATION_MONDAY"},{value:"tue",name:"APPLICATION_TUESDAY"},{value:"wed",name:"APPLICATION_WEDNESDAY"},{value:"thu",name:"APPLICATION_THURSDAY"},{value:"fri",name:"APPLICATION_FRIDAY"},{value:"sat",name:"APPLICATION_SATURDAY"},{value:"sun",name:"APPLICATION_SUNDAY"}],daysOfMonth:["always",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]};return{interval:a}}),angular.module("xCallyShuttleApp").service("report",["ReportAgent","ReportCall","ReportMailSession","ReportMember","ReportQueue","ReportIntegration","ReportChatSession","ReportSmsSession","Contact","Recording","ReportSquare","ReportSquareDetail","User","ReportFaxSession","MailRoom","MailMessage","FaxRoom","FaxMessage","ChatRoom","ChatMessage","SmsRoom","SmsMessage","OpenChannelRoom","OpenChannelMessage","ReportOpenChannelSession",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){var z=[{value:"users",resource:m,channel:"General"},{value:"cm_contacts",resource:i,channel:"General"},{value:"report_integration_history",resource:f,channel:"General"},{value:"report_agent_history",resource:a,channel:"Voice"},{value:"report_call_history",resource:b,channel:"Voice"},{value:"report_member_history",resource:d,channel:"Voice"},{value:"report_queue_history",resource:e,channel:"Voice"},{value:"voice_recordings",resource:j,channel:"Voice"},{value:"report_square_history",resource:k,channel:"Voice"},{value:"report_square_details_history",resource:l,channel:"Voice"},{value:"report_chat_session_history",resource:g,channel:"Chat"},{value:"chat_rooms",resource:s,channel:"Chat"},{value:"chat_messages",resource:t,channel:"Chat"},{value:"report_mail_session_history",resource:c,channel:"Mail"},{value:"mail_rooms",resource:o,channel:"Mail"},{value:"mail_messages",resource:p,channel:"Mail"},{value:"report_fax_session_history",resource:n,channel:"Fax"},{value:"fax_rooms",resource:q,channel:"Fax"},{value:"fax_messages",resource:r,channel:"Fax"},{value:"report_sms_session_history",resource:h,channel:"Sms"},{value:"sms_rooms",resource:u,channel:"Sms"},{value:"sms_messages",resource:v,channel:"Sms"},{value:"report_openchannel_session_history",resource:y,channel:"Open Channel"},{value:"openchannel_rooms",resource:w,channel:"Open Channel"},{value:"openchannel_messages",resource:x,channel:"Open Channel"}];return{tables:z}}]),angular.module("xCallyShuttleApp").service("strategies",function(){return["beepall","roundrobin","rrmemory"]}),angular.module("xCallyShuttleApp").service("triggers",["VoiceQueue","Route",function(a,b){var c={voice:{conditions:[{name:"APPLICATION_QUEUE",value:"queue",type:"select",resource:a,resValue:"name",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_CALL_STATUS",value:"lastevent",type:"select",arr:[{name:"ringing",value:"called"},{name:"up",value:"connect"},{name:"hangup",value:"complete"},{name:"rejected",
+value:"rejected"},{name:"abandoned",value:"abandoned"}],operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_OUTBOUND_ROUTE",value:"routeId",type:"select",resource:b,resValue:"id",resName:"exten",params:{type:"outbound"},operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]}],actions:[{name:"APPLICATION_CONTACT_MANAGER",value:"contactManager"},{name:"APPLICATION_INTEGRATIONS",value:"integration",propertyField:"select"},{name:"APPLICATION_MOTION_BAR",value:"motionbar",propertyField:"select"},{name:"APPLICATION_JSCRIPTY",value:"jscripty",propertyField:"select"},{name:"APPLICATION_URL_FORWARD",value:"urlForward"}]},mail:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_TO",value:"to",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_CC",value:"cc",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_SUBJECT",value:"subject",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_BODY",value:"text",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_TEMPLATE",value:"template"},{name:"APPLICATION_EMAIL",value:"email"},{name:"APPLICATION_FORWARD",value:"forward"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]},chat:{conditions:[{name:"APPLICATION_NAME",value:"fullname",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"}]},{name:"APPLICATION_EMAIL",value:"email",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_EMAIL",value:"accountEmail"},{name:"APPLICATION_TEMPLATE",value:"accountTemplate"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]},sms:{conditions:[{name:"APPLICATION_FROM",value:"from",type:"input",operators:[{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]},{name:"APPLICATION_BODY",value:"body",type:"input",operators:[{value:"equals",name:"APPLICATION_EQUALS_TO"},{value:"not_equals",name:"APPLICATION_NOT_EQUALS_TO"},{value:"contains",name:"APPLICATION_CONTAINS"},{value:"not_contains",name:"APPLICATION_NOT_CONTAINS"}]}],actions:[{name:"APPLICATION_EMAIL",value:"accountEmail"},{name:"APPLICATION_TEMPLATE",value:"accountTemplate"},{name:"APPLICATION_TAG",value:"tag"},{name:"APPLICATION_HTTP_REQUEST",value:"http"},{name:"APPLICATION_CLOSE",value:"close"}]}},d=["voice","mail","chat","sms"];return{services:c,channels:d}}]),angular.module("xCallyShuttleApp").service("variable",function(){var a=[{title:"Unique ID",name:"uniqueid",group:"voice_queue"},{title:"Caller Number",name:"calleridnum",group:"voice_queue"},{title:"Caller Name",name:"calleridname",group:"voice_queue"},{title:"Queue",name:"queue",group:"voice_queue"},{title:"Called Number",name:"destcalleridnum",group:"voice_queue"},{title:"Called Name",name:"destcalleridname",group:"voice_queue"},{title:"Hold Time",name:"holdtime",group:"voice_queue"},{title:"Talk Time",name:"talktime",group:"voice_queue"},{title:"Connected Time",name:"agentconnectAt",group:"voice_queue"},{title:"Called Time",name:"agentcalledAt",group:"voice_queue"},{title:"DNID",name:"destexten",group:"voice_queue"},{title:"Complete Time",name:"agentcompleteAt",group:"voice_queue"},{title:"No Answer Time",name:"agentringnoanswerAt",group:"voice_queue"},{title:"Recording URL",name:"recordingURL",group:"voice_queue"},{title:"Unique ID",name:"uniqueid",group:"voice_outbound"},{title:"Caller Number",name:"calleridnum",group:"voice_outbound"},{title:"Caller Name",name:"calleridname",group:"voice_outbound"},{title:"Called Number",name:"destcalleridnum",group:"voice_outbound"},{title:"Called Name",name:"destcalleridname",group:"voice_outbound"},{title:"Start Time",name:"starttime",group:"voice_outbound"},{title:"Answer Time",name:"answertime",group:"voice_outbound"},{title:"Complete Time",name:"endtime",group:"voice_outbound"},{title:"Recording URL",name:"recordingURL",group:"voice_outbound"},{title:"Member Name",name:"membername",group:"voice_outbound"}];return a}),angular.module("xCallyShuttleApp").controller("SidebarController",["$scope","$rootScope","$resource","$location","Auth","Dashboard","Integration","xAlert","$stateParams","socket","$uibModal","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l){a.Auth=e,a.$on("$includeContentLoaded",function(){Metronic.init(),Layout.initSidebar()}),a.getSidebarDashboards=function(){return f.get().$promise.then(function(b){a.dashboards=b.rows,j.syncUpdates("dashboard",a.dashboards)})["catch"](function(){h.show("Error loading your dashboards","danger")})},a.about=function(){k.open({animation:!0,size:"sm",templateUrl:"app/main/about.modal.html",controller:["$scope","$uibModalInstance",function(a,b){a.year=moment().year(),a.getInfo=function(){return l.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},a.close=function(){b.dismiss("cancel")}}]})},a.getSidebarIntegrations=function(){return e.isAdmin()||e.isAgent()||b.userModules[19]?g.get().$promise.then(function(b){a.integrations=b.rows,j.syncUpdates("integration",a.integrations)})["catch"](function(a){h.error(a)}):void 0},a.$on("sidebar $destroy",function(){console.log("destroy"),j.unsyncUpdates("dashboard"),j.unsyncUpdates("integration")})}]),angular.module("xCallyShuttleApp").factory("socket",["$rootScope","$window","socketFactory","Auth",function(a,b,c,d){var e=d.getCurrentUser(),f=io("",{query:"token="+d.getToken()+"&userId="+e.id+"&name="+e.name+"&role="+(e.role||"agent")+"&source=browser",path:"/socket.io-client"}),g=c({ioSocket:f});return a.$on("logout",function(){g&&(g.disconnect(!0),b.location.reload())}),{socket:g,syncUpdates:function(a,b,c){c=c||angular.noop,g.on(a+":save",function(a){var d=_.find(b,{id:a.id}),e=b.indexOf(d),f="created";d?(_.merge(b[e],a),f="updated"):b.unshift(a),c(f,a,b)}),g.on(a+":remove",function(a){var d="deleted";_.remove(b,{id:a.id}),c(d,a,b)})},unsyncUpdates:function(a){g.removeAllListeners(a+":save"),g.removeAllListeners(a+":remove")},syncUpdatesByAttributes:function(a,b,c,d){d=d||angular.noop,g.on(a+":save",function(a){var e=!0;if(_.forIn(b,function(b,c){return a[c]&&a[c]===b?!0:e=!1}),e){var f=_.find(c,{id:a.id}),g=c.indexOf(f),h="created";f?(_.merge(c[g],a),h="updated"):c.unshift(a),d(h,a,c)}}),g.on(a+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},syncMailMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncMailMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")},syncFaxMessageUpdates:function(a,b,c,d){d=d||angular.noop,g.on(a+":"+b+":save",function(a){var b=_.find(c,{id:a.id}),e=c.indexOf(b),f="created";b?(_.merge(c[e],a),f="updated"):c.unshift(a),d(f,a)}),g.on(a+":"+b+":remove",function(a){var b="deleted";_.remove(c,{id:a.id}),d(b,a,c)})},unsyncFaxMessageUpdates:function(a,b){g.removeAllListeners(a+":"+b+":save"),g.removeAllListeners(a+":"+b+":remove")}}}]),function(a,b){angular.module("adf.widget.counter",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("counter",{title:"Single Value",description:"Single Value for db results",templateUrl:"{widgetsPath}/counter/src/view.html",controller:"apiwidgetCounterViewCtrl",edit:{templateUrl:"{widgetsPath}/counter/src/edit.html",controller:"apiwidgetCounterEditCtrl"}})}]).service("apiServiceCounter",["Widget",function(a){return{get:function(b){return a.get({select:b.select,condition:encodeURIComponent(b.condition),table:b.report.replace("_history",""),controller:"counter"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiwidgetCounterEditCtrl",["$scope","report",function(a,b){a.config.reportTables=b.tables,a.config.colors=[{name:"Grey",value:"grey"},{name:"Grey 2",value:"grey-cascade"},{name:"Grey 3",value:"grey-silver"},{name:"Grey 4",value:"grey-steel"},{name:"Grey 5",value:"grey-carrara"},{name:"Grey 6",value:"grey-gallery"},{name:"Blue",value:"blue"},{name:"Blue 2",value:"blue-hoki"},{name:"Blue 3",value:"blue-steel"},{name:"Blue 4",value:"blue-madison"},{name:"Blue 5",value:"blue-chambray"},{name:"Blue 6",value:"blue-ebonyclay"},{name:"Red",value:"red"},{name:"Red 2",value:"red-pink"},{name:"Red 3",value:"red-sunglo"},{name:"Red 4",value:"red-intense"},{name:"Red 5",value:"red-thunderbird"},{name:"Red 6",value:"red-flamingo"},{name:"Green",value:"green"},{name:"Green 2",value:"green-meadow"},{name:"Green 3",value:"green-seagreen"},{name:"Green 4",value:"green-turquoise"},{name:"Green 5",value:"green-haze"},{name:"Green 6",value:"green-jungle"},{name:"Purple",value:"purple"},{name:"Purple 2",value:"purple-plum"},{name:"Purple 3",value:"purple-medium"},{name:"Purple 4",value:"purple-studio"},{name:"Purple 5",value:"purple-wisteria"},{name:"Purple 6",value:"purple-seance"},{name:"Yellow",value:"yellow"},{name:"Yellow 2",value:"yellow-gold"},{name:"Yellow 3",value:"yellow-casablanca"},{name:"Yellow 4",value:"yellow-crusta"},{name:"Yellow 5",value:"yellow-lemon"},{name:"Yellow 6",value:"yellow-saffron"}],a.config.icons=[{name:"Talk bubbles",value:"fa-comments"},{name:"Bar Chart",value:"fa-bar-chart"},{name:"Shopping Cart",value:"fa-shopping-cart"},{name:"Globe",value:"fa-globe"},{name:"Volume Control Phone",value:"fa-volume-control-phone"},{name:"Comments",value:"fa-comments-o"},{name:"Commenting",value:"fa-commenting-o"},{name:"Coffee",value:"fa-coffee"},{name:"Clock",value:"fa-clock-o"},{name:"Envelope",value:"fa-envelope-o"},{name:"Hourglass",value:"fa-hourglass-half"},{name:"Percent",value:"fa-percent"}],a.config.select=a.config.select?a.config.select:"COUNT(*)",a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE"}]).controller("apiwidgetCounterViewCtrl",["$scope","$interval","apiServiceCounter",function(a,b,c){a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.condition=a.config.condition?a.config.condition:null,a.config.color=a.config.color?a.config.color:"blue-madison",a.config.icon=a.config.icon?a.config.icon:"fa-comments",a.config.link=a.config.link?a.config.link:"#",a.config.linkText=a.config.linkText?a.config.linkText:"VIEW MORE",a.counterApiCall=function(){a.config.report&&c.get(a.config).then(function(b){b?b.result&&b.result.length>1||_.keys(b.result[0]).length>1?(a.tooManyResults=!0,a.result=null):(a.tooManyResults=!1,null!==_.values(b.result[0])[0]?a.result=_.values(b.result[0])[0].toString():a.result="--"):a.result=null})},a.counterApiCall();var d=b(function(){a.counterApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.counter").run(["$templateCache",function(a){a.put("{widgetsPath}/counter/src/edit.html","<form role=form><div class=form-group><label for=select>Select</label> <input type=text class=form-control id=condition ng-model=config.select placeholder=Select></div><div class=form-group><label class=control-label>From</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=From>{{'APPLICATION_'+$select.selected.value.toUpperCase() | translate}}</ui-select-match><ui-select-choices repeat=\"table.value as table in config.reportTables | filter: $select.search\"><div ng-bind-html=\"'APPLICATION_'+table.value.toUpperCase() | translate | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div class=form-group><label for=condition>Where</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=Where></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=5></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_COLOR' | translate}}</label><ui-select data-ng-model=config.color name=color theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_COLOR' | translate }}\"><div data-ng-class=\"'bg-'+$select.selected.value\">&nbsp;</div></ui-select-match><ui-select-choices repeat=\"color.value as color in config.colors | filter: $select.search\"><div data-ng-class=\"'bg-'+color.value\">&nbsp;</div></ui-select-choices></ui-select></div><div class=form-group><label class=control-label>{{'APPLICATION_WIDGET_ICON' | translate}}</label><ui-select data-ng-model=config.icon name=icon theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_WIDGET_ICON' | translate }}\"><i class=fa ng-class=$select.selected.value></i></ui-select-match><ui-select-choices repeat=\"icon.value as icon in config.icons | filter: $select.search\"><i class=fa ng-class=icon.value></i></ui-select-choices></ui-select></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_DETAILS' | translate}}</label> <input type=text class=form-control id=details ng-model=config.details maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_DETAILS' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK' | translate}}</label> <input type=text class=form-control id=link ng-model=config.link placeholder=http://yourlink></div><div class=form-group><label for=condition>{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}</label> <input type=text class=form-control id=linkText ng-model=config.linkText maxlength=30 placeholder=\"{{'APPLICATION_WIDGET_LINK_TEXT' | translate}}\"></div></form>"),a.put("{widgetsPath}/counter/src/view.html",'<div class=dashboard-stat ng-class=config.color ng-if=result><div class=visual><i class=fa ng-class=config.icon></i></div><div class=details><div class=number>{{result}}</div><div class=desc>{{config.details}}</div></div><a class=more href={{config.link}}>{{config.linkText}} <i class="m-icon-swapright m-icon-white"></i></a></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=tooManyResults><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_TOO_MANY_RESULTS\' | translate}}</div><div class="alert alert-danger" role=alert ng-if="!result && !tooManyResults"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_QUERY_NOT_VALID\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.pie-chart",["adf.provider"]).config(["dashboardProvider",function(a){a.widget("pie-chart",{title:"Pie-Chart",description:"Display a pie-chart starting from DB values",templateUrl:"{widgetsPath}/pie-chart/src/view.html",controller:"apiWidgetPieChartViewCtrl",edit:{templateUrl:"{widgetsPath}/pie-chart/src/edit.html",controller:"apiWidgetPieChartEditCtrl"}})}]).service("apiServicePieChart",["Widget",function(a){return{get:function(b){return a.get({condition:encodeURIComponent(b.condition),table:b.report.replace("_history",""),fields:b.fields,controller:"piechart"}).$promise.then(function(a){return a})["catch"](function(a){console.log(a)})}}}]).controller("apiWidgetPieChartEditCtrl",["$scope","report",function(a,b){function c(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=b.tables,a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){c().push({})},a.removeField=function(a){c().splice(a,1)}}]).controller("apiWidgetPieChartViewCtrl",["$scope","$interval","apiServicePieChart",function(a,b,c){a.config.timeout=a.config.timeout>=5?a.config.timeout:5,a.pieChartApiCall=function(){a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){if(b&&b.result&&1===b.result.length){a.labels=[],a.data=[];for(var c in b.result[0])a.labels.push(c),a.data.push(b.result[0][c])}else a.labels=[],a.data=[]})},a.pieChartApiCall();var d=b(function(){a.pieChartApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.pie-chart").run(["$templateCache",function(a){a.put("{widgetsPath}/pie-chart/src/edit.html","<form role=form><div class=form-group><label class=control-label>{{'APPLICATION_REPORT' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder=\"{{ 'APPLICATION_REPORT' | translate }}\">{{'APPLICATION_'+$select.selected.value.toUpperCase() | translate}}</ui-select-match><ui-select-choices repeat=\"table.value as table in config.reportTables | filter: $select.search\"><div ng-bind-html=\"'APPLICATION_'+table.value.toUpperCase() | translate | highlight: $select.search\"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{'APPLICATION_FIELDS' | translate}}</label></div><div class=padding-bottom ng-repeat=\"field in config.fields\"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if=\"config.fields.length>1\"><button class=\"btn btn-danger\" type=button data-ng-click=removeField($index)><i class=\"fa fa-times\"></i> {{'APPLICATION_REMOVE' | translate}}</button></span></div></div></div><button type=button class=\"btn btn-sm green mbottom20\" ng-click=addField()><i class=\"fa fa-plus\"></i> {{'APPLICATION_ADD_FIELD' | translate}}</button><div class=form-group><label for=condition>{{'APPLICATION_CONDITION' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder=\"{{'APPLICATION_CONDITION' | translate}}\"></div><div class=form-group><label for=condition>{{'APPLICATION_REFRESH_TIMEOUT' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder=\"{{'APPLICATION_REFRESH_TIMEOUT' | translate}}\" min=5></div></form>"),a.put("{widgetsPath}/pie-chart/src/view.html",'<div ng-if=labels.length ng-style=config.style><canvas id=doughnut class="chart chart-doughnut" chart-data=data chart-labels=labels legend=true></canvas></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!labels.length><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_METRIC_AND_CHECK_OTHER\' | translate}}</div>')}])}(window),function(a,b){angular.module("adf.widget.table",["adf.provider"]).value("apiServiceUrlTable","/api/widgets/table").config(["dashboardProvider",function(a){a.widget("table",{title:"Table",description:"Show tabbed results from db",templateUrl:"{widgetsPath}/table/src/view.html",controller:"apiWidgetTableViewCtrl",edit:{templateUrl:"{widgetsPath}/table/src/edit.html",controller:"apiWidgetTableEditCtrl"}})}]).service("apiServiceTable",["$q","$http","apiServiceUrlTable",function(a,b,c){return{get:function(d){var e=a.defer();return b.get(c,{params:{condition:encodeURIComponent(d.condition),table:d.report,fields:d.fields}}).success(function(a){a?e.resolve(a):e.reject()}).error(function(a){console.log(a),e.reject()}),e.promise}}}]).controller("apiWidgetTableEditCtrl",["$scope",function(a){function b(){return a.config.fields||(a.config.fields=[{column:"",alias:""}]),a.config.fields}a.config.reportTables=[{name:"Agents",value:"agent"},{name:"Calls",value:"call"},{name:"Dials",value:"dial"},{name:"Members",value:"member"},{name:"Queues",value:"queue"}],a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.fields=a.config.fields?a.config.fields:[{column:"",alias:""}],a.addField=function(){b().push({})},a.removeField=function(a){b().splice(a,1)}}]).controller("apiWidgetTableViewCtrl",["$scope","$interval","apiServiceTable",function(a,b,c){a.config.timeout=a.config.timeout?a.config.timeout:1,a.config.height=a.config.height?a.config.height:350,a.config.style={"max-height":a.config.height+"px",overflow:"scroll"},a.tableApiCall=function(){a.config.condition&&a.config.report&&a.config.fields.length&&""!==a.config.fields[0].column&&""!==a.config.fields[0].alias&&c.get(a.config).then(function(b){a.results=b})},a.tableApiCall();var d=b(function(){a.tableApiCall()},1e3*parseInt(a.config.timeout));a.$on("$destroy",function(){b.cancel(d)})}]),angular.module("adf.widget.table").run(["$templateCache",function(a){a.put("{widgetsPath}/table/src/edit.html",'<form role=form><div class=form-group><label class=control-label>{{\'APPLICATION_REPORT\' | translate}}</label><ui-select data-ng-model=config.report name=report theme=bootstrap><ui-select-match placeholder="{{ \'APPLICATION_REPORT\' | translate }}">{{$select.selected.name}}</ui-select-match><ui-select-choices repeat="report.value as report in config.reportTables | filter: $select.search"><div ng-bind-html="report.name | highlight: $select.search"></div></ui-select-choices></ui-select></div><div><label class=control-label>{{\'APPLICATION_METRICS\' | translate}}</label></div><div class=padding-bottom ng-repeat="field in config.fields"><div class=form-group><div class=input-group><input type=text class=form-control ng-model=field.column> <span class=input-group-addon>as</span> <input type=text class=form-control ng-model=field.alias> <span class=input-group-btn ng-if="config.fields.length>1"><button class="btn btn-danger" type=button data-ng-click=removeField($index)><i class="fa fa-times"></i> {{\'APPLICATION_REMOVE\' | translate}}</button></span></div></div></div><button type=button class="btn btn-sm green mbottom20" ng-click=addField()><i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}</button><div class=form-group><label for=condition>{{\'APPLICATION_CONDITION\' | translate}}</label> <input type=text class=form-control id=condition ng-model=config.condition placeholder="{{\'APPLICATION_CONDITION\' | translate}}"></div><div class=form-group><label for=condition>{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}</label> <input type=number class=form-control id=timeout ng-model=config.timeout placeholder="{{\'APPLICATION_REFRESH_TIMEOUT\' | translate}}" min=1></div><div class=form-group><label for=condition>{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}</label> <input type=number class=form-control id=height ng-model=config.height placeholder="{{\'APPLICATION_WIDGET_MAX_HEIGHT\' | translate}}" min=350></div></form>'),a.put("{widgetsPath}/table/src/view.html",'<div ng-if=results ng-style=config.style><table st-table=results class="table table-striped table-bordered table-hover"><div class=table-responsive><thead><tr><th colspan={{config.fields.length}}><div class=row><div class=col-md-6></div><div class=col-md-6><div class="input-group input-medium pull-right"><input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class=form-control type=search> <span class=input-group-addon><i class="fa fa-search"></i></span></div></div></div></th></tr><tr><th ng-repeat="field in config.fields">{{field.alias}}</th></tr></thead><tbody><tr data-ng-repeat="result in results" class=animate-repeat><td ng-repeat="field in config.fields">{{result[field.alias]}}</td></tr><tr data-ng-hide=results.length><td colspan={{config.fields.length}} style=text-align:center;><i>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</i></td></tr></tbody><tfoot><tr><td colspan={{config.fields.length}} class=text-center><div st-pagination class=pagination st-items-by-page=10 st-displayed-pages=3></div></td></tr></tfoot></div></table></div><div class="alert alert-danger" role=alert ng-if=!config.report><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_WIDGET_SELECT_REPORT\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_VALID_CONDITION\' | translate}}</div><div class="alert alert-danger" role=alert ng-if=!results><span class="glyphicon glyphicon-exclamation-sign" aria-hidden=true></span> <span class=sr-only>{{\'APPLICATION_ERROR\' | translate}}:</span> {{\'MESSAGE_ENTER_ONE_VALID_FIELD_AND_CHECK_OTHER\' | translate}}</div>')}])}(window);var Metronic=function(){var a,b=!1,c=!1,d=!1,e=!1,f=[],g="assets/",h="img/",i="plugins/",j="css/",k={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},l=function(){"rtl"===$("body").css("direction")&&(b=!0),c=!!navigator.userAgent.match(/MSIE 8.0/),d=!!navigator.userAgent.match(/MSIE 9.0/),e=!!navigator.userAgent.match(/MSIE 10.0/),e&&$("html").addClass("ie10"),(e||d||c)&&$("html").addClass("ie")},m=function(){for(var a=0;a<f.length;a++){var b=f[a];b.call()}},n=function(){var a;if(c){var b;$(window).resize(function(){b!=document.documentElement.clientHeight&&(a&&clearTimeout(a),a=setTimeout(function(){m()},50),b=document.documentElement.clientHeight)})}else $(window).resize(function(){a&&clearTimeout(a),a=setTimeout(function(){m()},50)})},o=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(a){a.preventDefault();var b=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen"),b.find(".portlet-title .fullscreen").tooltip("destroy"),b.find(".portlet-title > .tools > .reload").tooltip("destroy"),b.find(".portlet-title > .tools > .remove").tooltip("destroy"),b.find(".portlet-title > .tools > .config").tooltip("destroy"),b.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy"),b.remove()}),$("body").on("click",".portlet > .portlet-title .fullscreen",function(a){a.preventDefault();var b=$(this).closest(".portlet");if(b.hasClass("portlet-fullscreen"))$(this).removeClass("on"),b.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height","auto");else{var c=Metronic.getViewPort().height-b.children(".portlet-title").outerHeight()-parseInt(b.children(".portlet-body").css("padding-top"))-parseInt(b.children(".portlet-body").css("padding-bottom"));$(this).addClass("on"),b.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),b.children(".portlet-body").css("height",c)}}),$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(a){a.preventDefault();var b=$(this).closest(".portlet").children(".portlet-body"),c=$(this).attr("data-url"),d=$(this).attr("data-error-display");c?(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:c,dataType:"html",success:function(a){Metronic.unblockUI(b),b.html(a)},error:function(a,c,e){Metronic.unblockUI(b);var f="Error on reloading the content. Please check your connection and try again.";"toastr"==d&&toastr?toastr.error(f):"notific8"==d&&$.notific8?($.notific8("zindex",11500),$.notific8(f,{theme:"ruby",life:3e3})):alert(f)}})):(Metronic.blockUI({target:b,animate:!0,overlayColor:"none"}),window.setTimeout(function(){Metronic.unblockUI(b)},1e3))}),$('.portlet .portlet-title a.reload[data-load="true"]').click(),$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(a){a.preventDefault()})},p=function(){if($().uniform){var a=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");a.size()>0&&a.each(function(){0===$(this).parents(".checker").size()&&$(this).show()})}},q=function(){$().iCheck&&$(".icheck").each(function(){var a=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",b=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";a.indexOf("_line")>-1||b.indexOf("_line")>-1?$(this).iCheck({checkboxClass:a,radioClass:b,insert:'<div class="icheck_line-icon"></div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:a,radioClass:b})})},r=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},s=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},t=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(a){Metronic.scrollTo($(a.target))})},u=function(){if(location.hash){var a=location.hash.substr(1);$('a[href="#'+a+'"]').parents(".tab-pane:hidden").each(function(){var a=$(this).attr("id");$('a[href="#'+a+'"]').click()}),$('a[href="#'+a+'"]').click()}},v=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")}),$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")}),$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")}),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip(),$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"}),$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"}),$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"}),$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"}),$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"})},x=function(){
+$("body").on("click",".dropdown-menu.hold-on-click",function(a){a.stopPropagation()})},y=function(){$("body").on("click",'[data-close="alert"]',function(a){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-close="note"]',function(a){$(this).closest(".note").hide(),a.preventDefault()}),$("body").on("click",'[data-remove="note"]',function(a){$(this).closest(".note").remove(),a.preventDefault()})},z=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")})},A=function(){$(".popovers").popover(),$(document).on("click.bs.popover.data-api",function(b){a&&a.popover("hide")})},B=function(){Metronic.initSlimScroll(".scroller")},C=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},D=function(){(c||d)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var a=$(this);""===a.val()&&""!==a.attr("placeholder")&&a.addClass("placeholder").val(a.attr("placeholder")),a.focus(function(){a.val()==a.attr("placeholder")&&a.val("")}),a.blur(function(){(""===a.val()||a.val()==a.attr("placeholder"))&&a.val(a.attr("placeholder"))})})},E=function(){$().select2&&$(".select2me").select2({placeholder:"Select"})};return{init:function(){l(),n(),p(),q(),r(),B(),C(),E(),o(),y(),x(),u(),w(),A(),t(),v(),s(),D()},initAjax:function(){p(),q(),r(),z(),B(),E(),C(),x(),w(),A(),t(),s()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(b){a=b},addResizeHandler:function(a){f.push(a)},runResizeHandlers:function(){m()},scrollTo:function(a,b){var c=a&&a.size()>0?a.offset().top:0;a&&($("body").hasClass("page-header-fixed")&&(c-=$(".page-header").height()),c+=b?b:-1*a.height()),$("html,body").animate({scrollTop:c},"slow")},initSlimScroll:function(a){$(a).each(function(){if(!$(this).attr("data-initialized")){var a;a=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height"),$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:b?"left":"right",height:a,alwaysVisible:"1"==$(this).attr("data-always-visible")?!0:!1,railVisible:"1"==$(this).attr("data-rail-visible")?!0:!1,disableFadeOut:!0}),$(this).attr("data-initialized","1")}})},destroySlimScroll:function(a){$(a).each(function(){if("1"===$(this).attr("data-initialized")){$(this).removeAttr("data-initialized"),$(this).removeAttr("style");var a={};$(this).attr("data-handle-color")&&(a["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(a["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(a["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(a["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(a["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0});var b=$(this);$.each(a,function(a,c){b.attr(a,c)})}})},scrollTop:function(){Metronic.scrollTo()},blockUI:function(a){a=$.extend(!0,{},a);var b="";if(b=a.animate?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>':a.iconOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""></div>':a.textOnly?'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>":'<div class="loading-message '+(a.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif" align=""><span>&nbsp;&nbsp;'+(a.message?a.message:"LOADING...")+"</span></div>",a.target){var c=$(a.target);c.height()<=$(window).height()&&(a.cenrerY=!0),c.block({message:b,baseZ:a.zIndex?a.zIndex:1e3,centerY:void 0!==a.cenrerY?a.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})}else $.blockUI({message:b,baseZ:a.zIndex?a.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:a.overlayColor?a.overlayColor:"#555",opacity:a.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(a){a?$(a).unblock({onUnblock:function(){$(a).css("position",""),$(a).css("zoom","")}}):$.unblockUI()},startPageLoading:function(a){a&&a.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-blue.gif"/>&nbsp;&nbsp;<span>'+(a&&a.message?a.message:"Loading...")+"</span></div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(a){a=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},a);var b=Metronic.getUniqueID("Metronic_alert"),c='<div id="'+b+'" class="Metronic-alerts alert alert-'+a.type+' fade in">'+(a.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>':"")+(""!==a.icon?'<i class="fa-lg fa fa-'+a.icon+'"></i>  ':"")+a.message+"</div>";return a.reset&&$(".Metronic-alerts").remove(),a.container?"append"==a.place?$(a.container).append(c):$(a.container).prepend(c):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(c):$(".page-bar").size()>0?$(".page-bar").after(c):$(".page-breadcrumb").after(c),a.focus&&Metronic.scrollTo($("#"+b)),a.closeInSeconds>0&&setTimeout(function(){$("#"+b).remove()},1e3*a.closeInSeconds),b},initUniform:function(a){a?$(a).each(function(){0===$(this).parents(".checker").size()&&($(this).show(),$(this).uniform())}):p()},updateUniform:function(a){$.uniform.update(a)},initFancybox:function(){C()},getActualVal:function(a){return a=$(a),a.val()===a.attr("placeholder")?"":a.val()},getURLParameter:function(a){var b,c,d=window.location.search.substring(1),e=d.split("&");for(b=0;b<e.length;b++)if(c=e[b].split("="),c[0]==a)return unescape(c[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(a){return!1}},getViewPort:function(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}},getUniqueID:function(a){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return c},isIE9:function(){return d},isRTL:function(){return b},isAngularJsApp:function(){return"undefined"==typeof angular?!1:!0},getAssetsPath:function(){return g},setAssetsPath:function(a){g=a},setGlobalImgPath:function(a){h=a},getGlobalImgPath:function(){return g+h},setGlobalPluginsPath:function(a){i=a},getGlobalPluginsPath:function(){return g+i},getGlobalCssPath:function(){return g+j},getBrandColor:function(a){return k[a]?k[a]:""},getResponsiveBreakpoint:function(a){var b={xs:480,sm:768,md:900,lg:1200};return b[a]?b[a]:0}}}(),Layout=function(){var a="img/",b="css/",c=Metronic.getResponsiveBreakpoint("md"),d=function(){var a,b=$(".page-content"),d=$(".page-sidebar"),e=$("body");if(e.hasClass("page-footer-fixed")===!0&&e.hasClass("page-sidebar-fixed")===!1){var f=Metronic.getViewPort().height-$(".page-footer").outerHeight()-$(".page-header").outerHeight();b.height()<f&&b.attr("style","min-height:"+f+"px")}else{if(e.hasClass("page-sidebar-fixed"))a=g(),e.hasClass("page-footer-fixed")===!1&&(a-=$(".page-footer").outerHeight());else{var h=$(".page-header").outerHeight(),i=$(".page-footer").outerHeight();a=Metronic.getViewPort().width<c?Metronic.getViewPort().height-h-i:d.height()+20,a+h+i<=Metronic.getViewPort().height&&(a=Metronic.getViewPort().height-h-i)}b.attr("style","min-height:"+a+"px")}},e=function(a,b){var d=location.hash.toLowerCase(),e=$(".page-sidebar-menu");if("click"===a||"set"===a?b=$(b):"match"===a&&e.find("li > a").each(function(){var a=$(this).attr("href").toLowerCase();return a.length>1&&d.substr(1,a.length-1)==a.substr(1)?void(b=$(this)):void 0}),b&&0!=b.size()&&"javascript:;"!==b.attr("href").toLowerCase()&&"#"!==b.attr("href").toLowerCase()){parseInt(e.data("slide-speed")),e.data("keep-expanded");e.find("li.active").removeClass("active"),e.find("li > a > .selected").remove(),e.hasClass("page-sidebar-menu-hover-submenu")===!1?e.find("li.open").each(function(){0===$(this).children(".sub-menu").size()&&($(this).removeClass("open"),$(this).find("> a > .arrow.open").removeClass("open"))}):e.find("li.open").removeClass("open"),b.parents("li").each(function(){$(this).addClass("active"),$(this).find("> a > span.arrow").addClass("open"),1===$(this).parent("ul.page-sidebar-menu").size()&&$(this).find("> a").append('<span class="selected"></span>'),1===$(this).children("ul.sub-menu").size()&&$(this).addClass("open")}),"click"===a&&Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click()}},f=function(){jQuery(".page-sidebar").on("click","li > a",function(a){var b=$(this).next().hasClass("sub-menu");if(!(Metronic.getViewPort().width>=c&&1===$(this).parents(".page-sidebar-menu-hover-submenu").size())){if(b===!1)return void(Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click());if(!$(this).next().hasClass("sub-menu always-open")){var e=$(this).parent().parent(),f=$(this),g=$(".page-sidebar-menu"),h=jQuery(this).next(),i=g.data("auto-scroll"),j=parseInt(g.data("slide-speed")),k=g.data("keep-expanded");k!==!0&&(e.children("li.open").children("a").children(".arrow").removeClass("open"),e.children("li.open").children(".sub-menu:not(.always-open)").slideUp(j),e.children("li.open").removeClass("open"));var l=-200;h.is(":visible")?(jQuery(".arrow",jQuery(this)).removeClass("open"),jQuery(this).parent().removeClass("open"),h.slideUp(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})):b&&(jQuery(".arrow",jQuery(this)).addClass("open"),jQuery(this).parent().addClass("open"),h.slideDown(j,function(){i===!0&&$("body").hasClass("page-sidebar-closed")===!1&&($("body").hasClass("page-sidebar-fixed")?g.slimScroll({scrollTo:f.position().top}):Metronic.scrollTo(f,l)),d()})),a.preventDefault()}}}),jQuery(".page-sidebar").on("click"," li > a.ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=jQuery(".page-sidebar ul"),e=($(".page-content"),$(".page-content .page-content-body"));d.children("li.active").removeClass("active"),d.children("arrow.open").removeClass("open"),$(this).parents("li").each(function(){$(this).addClass("active"),$(this).children("a > span.arrow").addClass("open")}),$(this).parents("li").addClass("active"),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),Metronic.startPageLoading();var f=$(this);$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){0===f.parents("li.open").size()&&$(".page-sidebar-menu > li.open > a").click(),Metronic.stopPageLoading(),e.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){Metronic.stopPageLoading(),e.html("<h4>Could not load the requested content.</h4>")}})}),jQuery(".page-content").on("click",".ajaxify",function(a){a.preventDefault(),Metronic.scrollTop();var b=$(this).attr("href"),d=($(".page-content"),$(".page-content .page-content-body"));Metronic.startPageLoading(),Metronic.getViewPort().width<c&&$(".page-sidebar").hasClass("in")&&$(".page-header .responsive-toggler").click(),$.ajax({type:"GET",cache:!1,url:b,dataType:"html",success:function(a){Metronic.stopPageLoading(),d.html(a),Layout.fixContentHeight(),Metronic.initAjax()},error:function(a,b,c){d.html("<h4>Could not load the requested content.</h4>"),Metronic.stopPageLoading()}})}),i(),$(".page-sidebar").on("click",".sidebar-search .remove",function(a){a.preventDefault(),$(".sidebar-search").removeClass("open")}),$(".page-sidebar .sidebar-search").on("keypress","input.form-control",function(a){return 13==a.which?($(".sidebar-search").submit(),!1):void 0}),0!==$(".sidebar-search").size()&&($(".sidebar-search .input-group").on("click",function(a){a.stopPropagation()}),$("body").on("click",function(){$(".sidebar-search").hasClass("open")&&$(".sidebar-search").removeClass("open")}))},g=function(){var a=Metronic.getViewPort().height-$(".page-header").outerHeight();return $("body").hasClass("page-footer-fixed")&&(a-=$(".page-footer").outerHeight()),a},h=function(){var a=$(".page-sidebar-menu");return Metronic.destroySlimScroll(a),0===$(".page-sidebar-fixed").size()?void d():void(Metronic.getViewPort().width>=c&&(a.attr("data-height",g()),Metronic.initSlimScroll(a),d()))},i=function(){var a=$("body");a.hasClass("page-sidebar-fixed")&&$(".page-sidebar").on("mouseenter",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").removeClass("page-sidebar-menu-closed")}).on("mouseleave",function(){a.hasClass("page-sidebar-closed")&&$(this).find(".page-sidebar-menu").addClass("page-sidebar-menu-closed")})},j=function(){$("body");$.cookie&&"1"===$.cookie("sidebar_closed")&&Metronic.getViewPort().width>=c?($("body").addClass("page-sidebar-closed"),$(".page-sidebar-menu").addClass("page-sidebar-menu-closed")):$.cookie&&$.cookie("sidebar_closed","0")},k=function(){$(".page-header").on("click",'.hor-menu a[data-toggle="tab"]',function(a){a.preventDefault();var b=$(".hor-menu .nav"),c=b.find("li.current");$("li.active",c).removeClass("active"),$(".selected",c).remove();var d=$(this).parents("li").last();d.addClass("current"),d.find("a:first").append('<span class="selected"></span>')}),$(".page-header").on("click",".search-form",function(a){$(this).addClass("open"),$(this).find(".form-control").focus(),$(".page-header .search-form .form-control").on("blur",function(a){$(this).closest(".search-form").removeClass("open"),$(this).unbind("blur")})}),$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(a){return 13==a.which?($(this).closest(".search-form").submit(),!1):void 0}),$(".page-header").on("mousedown",".search-form.open .submit",function(a){a.preventDefault(),a.stopPropagation(),$(this).closest(".search-form").submit()}),$('[data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(),$(this).addClass("hover-initialized")}),$(document).on("click",".mega-menu-dropdown .dropdown-menu",function(a){a.stopPropagation()})},l=function(){$("body").on("shown.bs.tab",'a[data-toggle="tab"]',function(){d()})},m=function(){var a=300,b=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(c){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}):$(window).scroll(function(){$(this).scrollTop()>a?$(".scroll-to-top").fadeIn(b):$(".scroll-to-top").fadeOut(b)}),$(".scroll-to-top").click(function(a){return a.preventDefault(),$("html, body").animate({scrollTop:0},b),!1})},n=function(){var a,b=$(".full-height-content");if(a=Metronic.getViewPort().height-$(".page-header").outerHeight(!0)-$(".page-footer").outerHeight(!0)-$(".page-title").outerHeight(!0)-$(".page-bar").outerHeight(!0),b.hasClass("portlet")){var d=b.find(".portlet-body");if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(d.find(".full-height-content-body"));a=a-b.find(".portlet-title").outerHeight(!0)-parseInt(b.find(".portlet-body").css("padding-top"))-parseInt(b.find(".portlet-body").css("padding-bottom"))-2,b.hasClass("full-height-content-scrollable")?(a-=35,d.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(d.find(".full-height-content-body"))):d.css("min-height",a)}else{if(Metronic.getViewPort().width<c)return void Metronic.destroySlimScroll(b.find(".full-height-content-body"));b.hasClass("full-height-content-scrollable")?(a-=35,b.find(".full-height-content-body").css("height",a),Metronic.initSlimScroll(b.find(".full-height-content-body"))):b.css("min-height",a)}};return{initHeader:function(){k()},setSidebarMenuActiveLink:function(a,b){e(a,b)},initSidebar:function(){h(),f(),j(),Metronic.isAngularJsApp()&&e("match"),Metronic.addResizeHandler(h)},initContent:function(){n(),l(),Metronic.addResizeHandler(d),Metronic.addResizeHandler(n)},initFooter:function(){m()},init:function(){this.initHeader(),this.initSidebar(),this.initContent(),this.initFooter()},fixContentHeight:function(){d()},initFixedSidebarHoverEffect:function(){i()},initFixedSidebar:function(){h()},getLayoutImgPath:function(){return Metronic.getAssetsPath()+a},getLayoutCssPath:function(){return Metronic.getAssetsPath()+b}}}();angular.module("xCallyShuttleApp").run(["$templateCache",function(a){a.put("app/analytic/extracted/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="fa fa-file-pdf-o"></i>\n                                      <a href="/analytics/extracted/list">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a>\n                           </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="fa fa-file-pdf-o font-green-sharp"></i>\n                                     <span class="caption-subject">{{ \'APPLICATION_EXTRACTED_REPORTS\' | translate }}</a> </span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                        <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                  <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                              </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.metric.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-calculator"></i>\n                                       <a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <!-- <div class="portlet-title">\n                              <div class="caption font-green-sharp">\n                                        <i class="icon-calculator font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_DEFAULT_METRICS\' | translate }}</a> </span>\n                           </div>\n                                <div class="actions">\n                         </div>\n                        </div> -->\n                    <!-- <div class="portlet-body"> -->\n                           <!-- START TABLE -->\n                          <!-- <div ui-grid="gridOptionsDefault" data-ng-if="gridOptionsDefault" name="gridOptionsDefault"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                    <div class="watermark" ng-show="!gridOptionsDefault.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                               </div> -->\n                            <!-- END TABLE -->\n                    <!-- </div> -->\n                       <div class="portlet-title"><!-- removed margin-top20 class from title when commented the default metrics section-->\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-calculator font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_METRICS\' | translate }}</a> </span>\n                           </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                        <div class="btn-group">\n                                               <button class="btn green-jungle " ng-click="create()">\n                                                        <i class="icon-plus"></i> {{ \'APPLICATION_NEW_METRIC\' | translate }}\n                                                </button>\n                                     </div>\n                                        <!-- <a class="btn btn-icon-only btn-default fullscreen" href="#"></a> -->\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions" data-ng-if="gridOptions" name="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                       <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                              </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/list/view.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_METRIC\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.metric" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}</label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required readonly/>\n      <span data-ng-show="(forms.metric.name.$touched || forms.metric.$submitted) && forms.metric.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START TABLE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}</label>\n      <ui-select data-ng-model="item.table" name="table" theme="bootstrap" required data-ng-disabled="true">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n        <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.metric.table.$touched || forms.metric.$submitted) && forms.metric.table.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TABLE-->\n\n    <!-- START METRIC -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$invalid}">\n      <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}</label>\n      <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="item.metric" required readonly/></textarea>\n      <span data-ng-show="(forms.metric.metric.$touched || forms.metric.$submitted) && forms.metric.metric.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END METRIC -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description" readonly></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/analytic/metric/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMetric()">\n  <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-eye"></i>\n                                      <a href="/analytics/metrics/list">{{ \'APPLICATION_METRICS\' | translate }}</a>\n                                       <i data-ng-show="metric" class="fa fa-angle-right"></i>\n                               </li>\n                         <li data-ng-show="metric">\n                                    <a href="#">{{metric.name}}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET MAIN -->\n                 <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/metric.png" class="img-responsive">\n                             </div>\n                                <!-- END SIDEBAR USERPIC -->\n                          <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{metric.name}}\n                                       </div>\n                                        <!-- <div class="profile-usertitle-job">\n                                              {{user.role}}\n                                 </div> -->\n                            </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.analytics.metrics.view.settings\')}">\n                                                    <a data-ng-href="/analytics/metrics/view/{{metric.id}}/settings">\n                                                     <i class="icon-settings"></i>\n                                                 {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n                                                </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET MAIN -->\n             </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view class="profile-content">\n         </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/metric/view/view.settings.html",'<div class="row">\n   <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_METRIC\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} </span>\n                              </div>\n                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\n\n                      <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- GENERAL TAB -->\n                                  <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.general" data-ng-submit="forms.general.$valid && updateMetric()" novalidate>\n\n                                                      <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="metric.name" required/>\n                                                         <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END NAME -->\n\n                                                   <!-- START TABLE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="metric.table" name="table" theme="bootstrap" required>\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n                                                                  <ui-select-choices repeat="table.value as table in tables | filter: $select.search">\n                                                                          <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.general.table.$touched || forms.general.$submitted) && forms.general.table.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TABLE-->\n\n                                                   <!-- START METRIC -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_METRIC\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <textarea type="text" name="metric" placeholder="{{\'APPLICATION_METRIC\' | translate}}" class="form-control" data-ng-model="metric.metric" required/></textarea>\n                                                             <span data-ng-show="(forms.general.metric.$touched || forms.general.$submitted) && forms.general.metric.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END METRIC -->\n\n                                                 <!-- START DESCRIPTION -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                                              <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="metric.description"></textarea>\n                                                        </div>\n                                                        <!-- END DESCRIPTION -->\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ADVANCED TAB -->\n\n                           </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
 a.put("app/analytic/report/list/copy.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_COPY_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="portlet light bordered">\n    <div class="portlet-title">\n      <div class="caption font-green-sharp" style="padding-left:10px;">\n        <i class="icon-folder font-green-sharp"></i>\n        <span class="caption-subject">{{ \'APPLICATION_COPY_TO\' | translate }} </span>\n      </div>\n    </div>\n    <div class="portlet-body">\n      <div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;"></div>\n    </div>\n  </div>\n  <div class="has-error">\n    <span data-ng-show="showAlert" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_SELECT_FOLDER\' | translate}}.\n  </span>\n  </div>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_REPORT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.report" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" required/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"></textarea>\n    </div>\n    <!-- END DESCRIPTION -->\n\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PATH\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_PATH\' | translate}}" class="form-control" data-ng-model="path" disabled/>\n      <span data-ng-show="(forms.report.name.$touched || forms.report.$submitted) && forms.report.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/deleteNode.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DELETE_FOLDER\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<p>\n  {{\'MESSAGE_DELETE_NODE\' | translate}} : <b>{{node}}</b>?\n</p>\n<p>\n  {{\'MESSAGE_ALL_REPORTS_WILL_BE_DELETED\' | translate}}\n</p>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()" ng-disabled="forms.report.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/extract.modal.html",'<div class="modal-header">\n  <button type="button" ng-click="cancel()" class="close">×</button>\n  <h4 class="modal-title">{{ \'APPLICATION_EXTRACT_REPORT\' | translate }}</h4>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group" data-ng-class="{\'hidden\':daily}">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}</label>\n      <input type="daterange" name="dates" ranges="ranges" style="min-width:190px;" enabletimepicker="timepicker" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" max-date="{{maxdate}}" data-ng-required="!daily" data-ng-disabled="daily" data-ng-class="{\'disabled-invisible\':daily}" style="cursor:pointer;" readonly/>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <label class="control-label">{{\'APPLICATION_FROM\' | translate}}</label>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <uib-timepicker ng-model="dailyTime.start" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="false"></uib-timepicker>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <label class="control-label">{{\'APPLICATION_TO\' | translate}}</label>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <uib-timepicker ng-model="dailyTime.end" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="false"></uib-timepicker>\n    </div>\n      <!-- START STATUS -->\n      <div class="form-group">\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="daily"\n      type="checkbox"\n      name="auth"\n      switch-active="{{ dailySwitch.isActive }}"\n      switch-on-text="{{ dailySwitch.onText }}"\n      switch-off-text="{{ dailySwitch.offText }}"\n      switch-on-color="{{ dailySwitch.onColor }}"\n      switch-off-color="{{ dailySwitch.offColor }}"\n      switch-animate="{{ dailySwitch.animate }}"\n      switch-size="{{ dailySwitch.size }}"\n      switch-label="{{ dailySwitch.label }}"\n      switch-icon="{{ dailySwitch.icon }}"\n      switch-radio-off="{{ dailySwitch.radioOff }}"\n      switch-label-width="{{ dailySwitch.labelWidth }}"\n      switch-handle-width="{{ dailySwitch.handleWidth }}">\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn default green-jungle" type="button" data-ng-click="extract(\'csv\')"><i class="fa fa-file-excel-o"></i> {{ \'APPLICATION_SAVE_AS_CSV\' | translate }}</button>\n  <button class="btn default red-intense" type="button" data-ng-click="extract(\'pdf\')"><i class="fa fa-file-pdf-o"></i> {{ \'APPLICATION_SAVE_AS_PDF\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getTrees()">\n       <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-book-open"></i>\n                                        <a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n                <div class="col-fixed">\n                       <!-- BEGIN Portlet PORTLET-->\n                 <div class="portlet light bordered">\n                          <div class="portlet-title">\n                                   <div class="caption font-green-sharp" style="padding-left:10px;">\n                                             <i class="icon-folder font-green-sharp"></i>\n                                          <span class="caption-subject">{{ \'APPLICATION_FOLDERS\' | translate }} </span>\n                                       </div>\n                                        <div class="inputs">\n                                          <div class="portlet-input input-inline input-small">\n                                                  <div class="input-icon right">\n                                                                <i class="icon-magnifier"></i>\n                                                                <input type="text" data-ng-model="searchField" data-ng-change="searchTrees()" class="form-control input-circle" placeholder="search...">\n                                                      </div>\n                                                </div>\n                                        </div>\n                                </div>\n                                <div class="portlet-body">\n                                    <div js-tree="defaultTreeConfig" ng-model="defaultTreeData" should-apply="ac()" tree="defaultTreeInstance" tree-events="ready:initDefaultScopeTree;select_node:selectDefaultNode;"></div>\n                                     <div js-tree="customTreeConfig" ng-model="customTreeData" should-apply="ac()" tree="customTreeInstance" tree-events="ready:initCustomScopeTree;select_node:selectCustomNode;rename_node:updateCustomTree;delete_node:updateCustomTree;move_node:updateCustomTree;create_node:updateCustomTree;"></div>\n                                </div>\n                        </div>\n                        <!-- END Portlet PORTLET-->\n           </div>\n                <div class="row tree-row">\n                    <div class="col-md-12">\n                               <!-- BEGIN Portlet PORTLET-->\n                         <div class="portlet light bordered">\n                                  <div class="portlet-title">\n                                           <div class="caption font-green-sharp">\n                                                        <i class="icon-book-open font-green-sharp"></i>\n                                                       <span class="caption-subject">{{ \'APPLICATION_REPORTS\' | translate }}<span data-ng-if="selectedNode"> - {{selectedNode}}</span></span>\n                                              </div>\n                                                <div data-ng-if="!defaultTreeActive" class="actions">\n                                                 <div class="btn-group" data-ng-show="id.length">\n                                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                                           </a>\n                                                  </div>\n                                                        <div class="btn-group">\n                                                               <span class="btn default btn-file">\n                                                           <span class="fileinput-new">\n                                                          <i class="icon-cloud-upload"></i> {{\'APPLICATION_IMPORT_FROM_JSON\' | translate}}</span>\n                                                             <input type="file" on-read-file="import($fileContent)"/>\n                                                              </span>\n                                                       </div>\n                                                        <div class="btn-group">\n                                                               <button class="btn green-jungle " ng-click="create()">\n                                                                        <i class="icon-plus"></i> {{ \'APPLICATION_NEW_REPORT\' | translate }}\n                                                                </button>\n                                                     </div>\n                                                </div>\n                                        </div>\n                                        <div class="portlet-body">\n                                            <div ng-slide-down="gridOptions" lazy-render duration="1">\n                                            <!-- START TABLE -->\n                                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                                  <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                                              </div>\n                                                <!-- END TABLE -->\n                                    </div>\n                                        </div>\n                                </div>\n                                <!-- END Portlet PORTLET-->\n                   </div>\n                </div>\n        </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/list/preview.modal.html",'<div class="modal-header">\n  <button type="button" ng-click="cancel()" class="close">×</button>\n  <h4 class="modal-title">{{ \'APPLICATION_REPORT_PREVIEW\' | translate }}</h4>\n</div>\n<div class="modal-body" style="text-align:center;">\n  <form name="forms.report" class="form-inline mbottom20" novalidate>\n    <div class="form-group" data-ng-class="{\'hidden\':daily}">\n      <label class="control-label">{{\'APPLICATION_DATE_RANGE\' | translate}}<span class="required" aria-required="true"></span></label>\n      <input type="daterange" name="dates" ranges="ranges" style="min-width:190px;" enabletimepicker="timepicker" placeholder="{{\'APPLICATION_DATE_RANGE\' | translate}}" class="form-control" data-ng-model="dates" data-ng-change="getPage()" max-date="{{maxdate}}" data-ng-required="!daily" data-ng-disabled="daily" data-ng-class="{\'disabled-invisible\':daily}" style="cursor:pointer;" readonly/>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <label class="control-label">{{\'APPLICATION_FROM\' | translate}}</label>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <uib-timepicker ng-model="dailyTime.start" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="false"></uib-timepicker>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <label class="control-label">{{\'APPLICATION_TO\' | translate}}</label>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <uib-timepicker ng-model="dailyTime.end" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="false"></uib-timepicker>\n    </div>\n    <div class="form-group" data-ng-if="daily">\n      <button class="btn btn-small btn-sm btn-success" data-ng-click="getPage()">Apply</button>\n    </div>\n      <div class="form-group">\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="daily"\n      type="checkbox"\n      name="auth"\n      data-ng-change="getPage()"\n      switch-active="{{ dailySwitch.isActive }}"\n      switch-on-text="{{ dailySwitch.onText }}"\n      switch-off-text="{{ dailySwitch.offText }}"\n      switch-on-color="{{ dailySwitch.onColor }}"\n      switch-off-color="{{ dailySwitch.offColor }}"\n      switch-animate="{{ dailySwitch.animate }}"\n      switch-size="{{ dailySwitch.size }}"\n      switch-label="{{ dailySwitch.label }}"\n      switch-icon="{{ dailySwitch.icon }}"\n      switch-radio-off="{{ dailySwitch.radioOff }}"\n      switch-label-width="{{ dailySwitch.labelWidth }}"\n      switch-handle-width="{{ dailySwitch.handleWidth }}">\n    </div>\n  </form>\n  <div ng-slide-down="showResult" lazy-render duration="1">\n    <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-exporter class="grid extract-grid">\n      <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n    </div>\n  </div>\n</div>\n<div class="modal-footer">\n<button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/analytic/report/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getReport()">\n    <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-book-open"></i>\n                                        <a href="/analytics/reports/list">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n                                       <i data-ng-show="report" class="fa fa-angle-right"></i>\n                               </li>\n                         <li data-ng-show="report">\n                                    <a href="#">{{report.name}}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view class="profile-content">\n         </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/analytic/report/view/view.settings.html",'<div class="row">\n   <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <div class="caption-subject font-blue-madison bold uppercase dot">{{ \'APPLICATION_REPORT\' | translate}} {{ \'APPLICATION_SETTINGS\' | translate}} - {{report.name}} </div>\n                          </div>\n                                <ul class="nav nav-tabs">\n                                     <li>\n                                          <a href="#" data-target="#tab_1_1" data-toggle="tab">{{ \'APPLICATION_GENERAL\' | translate}}</a>\n                                     </li>\n                                 <li class="active">\n                                           <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_BUILD\' | translate}}</a>\n                                       </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_3" data-toggle="tab" data-ng-click="showResult = true">{{ \'APPLICATION_TEST_PREVIEW\' | translate}}</a>\n                                      </li>\n                         </ul>\n                 </div>\n\n                      <div class="portlet-body">\n\n                          <div class="tab-content">\n\n                                   <!-- GENERAL TAB -->\n                                  <div class="tab-pane" id="tab_1_1">\n                                           <form name="forms.general" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n\n                                                       <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="report.name" required/>\n                                                         <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$error.required" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END NAME -->\n\n                                                   <!-- START DESCRIPTION -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                                              <textarea type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="report.description"></textarea>\n                                                        </div>\n                                                        <!-- END DESCRIPTION -->\n\n                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}" />\n                                         </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n\n                                    <!-- BUILD TAB -->\n                                    <div class="tab-pane active" id="tab_1_2">\n                                            <form name="forms.report" data-ng-submit="forms.report.$valid && forms.general.$valid && updateReport()" novalidate>\n                                                  <!-- START TABLE INPUT -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_TABLE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="report.table" name="table" theme="bootstrap" required>\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{\'APPLICATION_\'+$select.selected.value.toUpperCase() | translate}}</ui-select-match>\n                                                                  <ui-select-choices group-by="\'channel\'" repeat="table.value as table in tables | filter: $select.search">\n                                                                           <div ng-bind-html="\'APPLICATION_\'+table.value.toUpperCase() | translate | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.report.table.$touched || forms.report.$submitted) && forms.report.table.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TABLE INPUT-->\n                                                       <div data-ng-if="report.table" class="mbottom20 pbottom20 table-responsive">\n                                                          <div class="portlet-title tabbable-line">\n                                                                     <div class="caption caption-md">\n                                                                              <i class="icon-globe theme-font hide"></i>\n                                                                            <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_FIELDS\' | translate}} </span>\n                                                                        </div>\n                                                                </div>\n                                                                <!-- START TABLE -->\n                                                          <table class="table table-striped table-bordered table-hover">\n                                                                        <thead>\n                                                                               <tr>\n                                                                                  <th>{{ \'APPLICATION_FIELD\' | translate }} / {{ \'APPLICATION_METRIC\' | translate }}</th>\n                                                                                   <th style="min-width:167px;">{{ \'APPLICATION_ALIAS\' | translate }}</th>\n                                                                                     <th>{{ \'APPLICATION_FUNCTION\' | translate }}</th>\n                                                                                   <th>{{ \'APPLICATION_FORMAT\' | translate }}</th>\n                                                                                     <th>{{ \'APPLICATION_GROUP_BY\' | translate }}</th>\n                                                                                   <th>{{ \'APPLICATION_ORDER_BY\' | translate }}</th>\n                                                                                   <th></th>\n                                                                                     <th style="min-width:66px;"></th>\n                                                                             </tr>\n                                                                 </thead>\n                                                                      <tbody ui-sortable="sortableOptions" data-ng-model="report.Fields">\n                                                                           <tr data-ng-repeat="field in report.Fields">\n                                                                                  <td>\n                                                                                          <!-- START FIELD -->\n                                                                                          <div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.field}">\n                                                                                                     <!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <div class="input-group">\n                                                                                                             <ui-select data-ng-if="!field.custom" data-ng-model="field.field" dynamic-name="randomName()" theme="bootstrap" on-select="setMetricId($item,$index)" required>\n                                                                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}"><span ng-bind-html="$select.selected.name"></span></ui-select-match>\n                                                                                                                     <ui-select-choices repeat="tableField.value as tableField in tableFields | filter: $select.search">\n                                                                                                                           <div ng-bind-html="tableField.name | highlight: $select.search"></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                          <input data-ng-if="field.custom" type="text" dynamic-name="randomName()" placeholder="{{\'APPLICATION_CUSTOM\' | translate}}" class="form-control" data-ng-model="field.field" required/>\n                                                                                                             <span class="input-group-btn">\n                                                                                                                                <button type="button" data-ng-click="toggleCustom(field)" class="btn btn-default">\n                                                                                                                                    <span class="icon-pencil" data-ng-class="{\'font-blue\':field.custom}"></span>\n                                                                                                                </button>\n                                                                                                             </span>\n                                                                                                       </div>\n                                                                                                        <span data-ng-show="forms.report.$submitted && !field.field" class="help-block help-block-error">\n                                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                                         </span>\n                                                                                               </div>\n                                                                                                <!-- END FIELD-->\n                                                                                     </td>\n                                                                                 <td>\n                                                                                          <!-- START ALIAS -->\n                                                                                          <div class="form-group" data-ng-class="{\'has-error\': forms.report.$submitted && !field.alias}">\n                                                                                                     <!-- <label class="control-label">{{\'APPLICATION_ALIAS\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <input type="text" dynamic-name="randomName()" placeholder="{{\'APPLICATION_ALIAS\' | translate}}" class="form-control" data-ng-model="field.alias" data-ng-pattern="\'[A-Za-z0-9 <>=,.%_\\\\+*!\\\\-\\\\[\\\\]]+\'" required/>\n                                                                                                       <span data-ng-show="forms.report.$submitted && !field.alias" class="help-block help-block-error">\n                                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                                         </span>\n                                                                                                       <span data-ng-show="forms.report.$submitted && !field.alias" class="help-block help-block-error">\n                                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_FORMAT\' | translate}}.\n                                                                                                           </span>\n                                                                                               </div>\n                                                                                                <!-- END ALIAS -->\n                                                                                    </td>\n                                                                                 <td>\n                                                                                          <!-- START FUNCTION -->\n                                                                                               <div class="form-group">\n                                                                                                      <!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <ui-select data-ng-model="field.function" name="function" theme="bootstrap">\n                                                                                                          <ui-select-match placeholder="{{\'APPLICATION_FUNCTION\' | translate}}" allow-clear>{{$select.selected.name}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="function.value as function in functions | filter: $select.search">\n                                                                                                                 <div ng-bind-html="function.name | highlight: $select.search"></div>\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                                <!-- END FUNCTION-->\n                                                                                  </td>\n                                                                                 <td>\n                                                                                          <!-- START FORMAT -->\n                                                                                         <div class="form-group">\n                                                                                                      <!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <ui-select data-ng-model="field.format" name="format" theme="bootstrap">\n                                                                                                              <ui-select-match placeholder="{{\'APPLICATION_FORMAT\' | translate}}" allow-clear>{{$select.selected.name}}</ui-select-match>\n                                                                                                         <ui-select-choices repeat="format.value as format in formatFunctions | filter: $select.search">\n                                                                                                                       <div ng-bind-html="format.name | highlight: $select.search"></div>\n                                                                                                            </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                                <!-- END FORMAT-->\n                                                                                    </td>\n                                                                                 <td>\n                                                                                          <!-- START GROUP_BY -->\n                                                                                               <div class="form-group">\n                                                                                                      <!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <ui-select data-ng-model="field.groupBy" name="groupBy" theme="bootstrap" required>\n                                                                                                           <ui-select-match placeholder="{{\'APPLICATION_GROUP_BY\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="groupBy.value as groupBy in groupByField | filter: $select.search">\n                                                                                                                        {{$translate.instant(groupBy.name)}}\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                                <!-- END GROUP_BY-->\n                                                                                  </td>\n                                                                                 <td>\n                                                                                          <!-- START ORDER_BY -->\n                                                                                               <div class="form-group">\n                                                                                                      <!-- <label class="control-label">{{\'APPLICATION_FIELD\' | translate}}<span class="required" aria-required="true">*</span></label> -->\n                                                                                                       <ui-select data-ng-model="field.orderBy" name="orderBy" theme="bootstrap">\n                                                                                                            <ui-select-match placeholder="{{\'APPLICATION_ORDER_BY\' | translate}}" allow-clear>{{$select.selected}}</ui-select-match>\n                                                                                                            <ui-select-choices repeat="orderBy in [\'ASC\',\'DESC\'] | filter: $select.search">\n                                                                                                                   <div ng-bind-html="orderBy | highlight: $select.search"></div>\n                                                                                                                </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                                <!-- END TABLE INPUT-->\n                                                                                       </td>\n                                                                                 <td class="report-field-remove">\n                                                                                              <button class="btn red" type="button" data-ng-click="removeField($index)"><i class="fa fa-times"></i></button>\n                                                                                        </td>\n                                                                                 <td class="report-field-handle">\n                                                                                              <!-- <img data-ng-src="assets/images/move.png" class="img-responsive"> -->\n                                                                                    </td>\n                                                                         </tr>\n                                                                         <tr data-ng-hide="report.Fields.length" class="unsortable">\n                                                                                   <td colspan="8" style="text-align:center;">\n                                                                                           <i>{{ \'MESSAGE_ADD_A_FIELD\' | translate }}</i>\n                                                                                      </td>\n                                                                         </tr>\n                                                                 </tbody>\n                                                              </table>\n                                                              <button type="button" class="btn btn-sm green padding-bottom" ng-click="addField()">\n                                                                  <i class="fa fa-plus"></i> {{\'APPLICATION_ADD_FIELD\' | translate}}\n                                                          </button>\n                                                             <!-- END TABLE -->\n                                                    </div>\n                                                        <div data-ng-if="report.Fields.length" class="mbottom20 pbottom20">\n                                                           <div class="portlet-title tabbable-line">\n                                                                     <div class="caption caption-md">\n                                                                              <i class="icon-globe theme-font hide"></i>\n                                                                            <span class="caption-subject font-blue-madison bold uppercase">{{ \'APPLICATION_CONDITIONS\' | translate}} </span>\n                                                                    </div>\n                                                                </div>\n                                                                <div class="alert alert-info">\n                                                                        <strong>Output</strong>\n                                                                       <br>\n                                                                  <span ng-bind-html="output"></span>\n                                                           </div>\n\n                                                              <report-builder group="report.conditions.group" fields="tableFields" forms="forms" firstCall=\'true\'></report-builder>\n                                                       </div>\n                                                        <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}" />\n                                         </form>\n                                       </div>\n                                        <!-- END BUILD TAB -->\n\n                                      <!-- PREVIEW TAB -->\n                                  <div class="tab-pane" id="tab_1_3">\n                                           <div ng-slide-down="showResult" lazy-render duration="0.5">\n                                                   <div ui-grid="gridOptions" data-ng-if="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-move-columns class="grid">\n                                                             <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                                                      </div>\n                                                </div>\n                                        </div>\n                                        <!-- END PREVIEW TAB -->\n\n                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/offline/list/list.html",'<div class="row">\n        <div class="col-md-12">\n                       <div class="page-bar">\n                                <ul class="page-breadcrumb">\n                                  <li>\n                                          <i class="icon-rocket"></i>\n                                           <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                           <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-puzzle"></i>\n                                           <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-bubble"></i>\n                                           <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                                <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-login"></i>\n                                            <a href="/channels/chat/offline/list">{{ \'APPLICATION_OFFLINE\' | translate }}</a>\n                                   </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n       <div class="col-md-12">\n               <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-question font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_OFFLINE_MESSAGES\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                  <div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n                            </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/offline/message/message.directive.html",'<div class="message">\n  <div class="row">\n    <div class="col-md-12">\n      <span class="bold">From: </span>\n      [<a href="" data-ng-click="openContact(message.email)">{{message.email}}</a>]\n    </div>\n  </div>\n  <br>\n  <span class="todo-tasklist-date">\n    <i class="icon-calendar"></i> {{message.createdAt | date:\'medium\'}} (<span am-time-ago="message.createdAt"></span>)\n  </span>\n  <hr>\n  <div class="body text-left message-body" data-ng-bind="message.text"></div>\n  <h5 data-ng-hide="message.text" class="media-heading"><i>{{\'MESSAGE_NO_AVAILABLE_TEXT\' | translate | lowercase}}</i></h5>\n</div>\n'),a.put("app/channels/chat/offline/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView();">\n     <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-puzzle"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-bubble"></i>\n                                   <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-login"></i>\n                                    <a href="/channels/chat/offline/list">Offline</a>\n                                     <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-user"></i>\n                                     <a href="#">{{enquiry.username}}</a>\n                          </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE CONTENT -->\n                <div class="portlet light">\n                   <div class="portlet-title">\n                           <div class="caption">\n                                 <span data-ng-if="enquiry.ChatWebsite" class="caption-subject font-green-sharp bold uppercase">{{enquiry.ChatWebsite.name}}</span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="row">\n                                     <div class="col-md-4">\n                                                <!-- Visitor Information -->\n                                          <div class="portlet">\n                                                 <div class="portlet-body">\n                                                            <v-accordion class="vAccordion--default">\n                                                                     <v-pane expanded="true">\n                                                                              <v-pane-header>\n                                                                                       <ng-letter-avatar data-ng-if="enquiry.ChatVisitor" height="40" width="40" data="{{enquiry.ChatVisitor.fullname}}" fontsize="25" avatarcustombgcolor="#B0B0B0" charCount="2" avatarcustomborder="border:2px solid #EA4C61" shape="round"></ng-letter-avatar>\n                                                                           </v-pane-header>\n                                                                              <v-pane-content>\n                                                                                      {{\'APPLICATION_NAME\' | translate}}:<p>{{enquiry.ChatVisitor.fullname}}</p>\n                                                                                  {{\'APPLICATION_EMAIL\' | translate}}:<p><a data-ng-click="openContact(enquiry.ChatVisitor.email)" href="">{{enquiry.ChatVisitor.email}}</a></p>\n                                                                                      <span data-ng-if="enquiry.ChatVisitor.labelOfflineData1">{{enquiry.ChatVisitor.labelOfflineData1}}: <p>{{enquiry.ChatVisitor.offlineData1}}</p></span>\n                                                                                        <span data-ng-if="enquiry.ChatVisitor.labelOfflineData2">{{enquiry.ChatVisitor.labelOfflineData2}}: <p>{{enquiry.ChatVisitor.offlineData2}}</p></span>\n                                                                                        <span data-ng-if="enquiry.ChatVisitor.labelOfflineData3">{{enquiry.ChatVisitor.labelOfflineData3}}: <p>{{enquiry.ChatVisitor.offlineData3}}</p></span>\n                                                                                        {{\'APPLICATION_REMOTE_ADDRESS\' | translate}}:<p>{{enquiry.ChatVisitor.remote_address}}</p>\n                                                                                  {{\'APPLICATION_BROWSER\' | translate}}:<p>{{enquiry.ChatVisitor.browser}}</p>\n                                                                                        {{\'APPLICATION_REFERER\' | translate}}:<p>{{enquiry.ChatVisitor.referer}} - {{enquiry.ChatWebsite.name}}</p>\n                                                                                 {{\'APPLICATION_OS\' | translate}}:<p>{{enquiry.ChatVisitor.os}}</p>\n                                                                          </v-pane-content>\n                                                                     </v-pane>\n                                                             </v-accordion>\n                                                        </div>\n                                                </div>\n                                        </div>\n                                        <div class="col-md-8">\n                                                <!-- Offline message -->\n                                              <div id="mail-box">\n                                                   <ul class="chats">\n                                                            <li class="in">\n                                                                       <enquiry-message message="enquiry" list-id="enquiry.ChatWebsite.ListId"></enquiry-message>\n                                                            </li>\n                                                 </ul>\n                                         </div>\n                                        </div>\n                                </div>\n                        </div>\n                        <!-- END PROFILE CONTENT -->\n          </div>\n        </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/chat/online/list/list.html",'<div class="row">\n   <div class="col-md-12">\n                       <div class="page-bar">\n                                <ul class="page-breadcrumb">\n                                  <li>\n                                          <i class="icon-rocket"></i>\n                                           <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                           <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-puzzle"></i>\n                                           <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-bubble"></i>\n                                           <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                                <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-login"></i>\n                                            <a href="/channels/chat/online/list">{{ \'APPLICATION_ONLINE\' | translate }}</a>\n                                     </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n       <div class="col-md-12">\n               <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-question font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_VISITORS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                  <div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n                            </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/online/view/view.detail.html",'<div class="row">\n        <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n                          </div>\n                        </div>\n                        <div class="portlet-body row" data-ng-init="initView()">\n                              <div class="col-md-6">\n                                        <div class="news-blocks">\n                                             <h3>\n                                                  <a href="#" class="inactive-link">{{\'APPLICATION_MESSAGES\' | translate}}</a>\n                                                        <!-- <a href="#" data-ng-click="export()" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a> -->\n                                                      <a href="api/chat/rooms/{{chatRoom.id}}/export" target="_blank" data-ng-show="chatRoom.ChatMessages.length" class="btn btn-sm blue pull-right"><i class="icon-cloud-download"></i> {{\'APPLICATION_EXPORT\' | translate}} CSV </a>\n                                                    <hr>\n                                          </h3>\n                                         <div class="news-block-tags">\n                                                 <em am-time-ago="chatRoom.ChatVisitor.ChatEnquiry.createdAt"></em>\n                                            </div>\n                                                <p>\n                                                   <div ng-scrollbars ng-scrollbars-config="config">\n                                                             <ul class="chats">\n                                                                    <li data-ng-class="{\'out\': message.User, \'in\':message.ChatVisitor}" data-ng-repeat="message in chatRoom.ChatMessages | orderBy:\'createdAt\'">\n                                                                            <img class="avatar" data-ng-src="api/users/avatar/{{message.User.userpic || \'unknown_avatar\'}}">\n                                                                            <div class="message">\n                                                                                 <span class="arrow">\n                                                                                  </span>\n                                                                                       <a href="#" class="name">\n                                                                                             {{message.User ? message.User.fullname : message.ChatVisitor.fullname}}\n                                                                                       </a>\n                                                                                  <span class="datetime">\n                                                                                               at {{message.createdAt | date: \'medium\'}}\n                                                                                   </span>\n                                                                                       <span class="body">\n                                                                                           {{message.body}}\n                                                                                      </span>\n                                                                               </div>\n                                                                        </li>\n                                                         </ul>\n                                                 </div>\n                                                </div>\n                                        </div>\n                                        <div class="col-md-6">\n                                                <div class="news-blocks">\n                                                     <h3>\n                                                          <a href="#" class="inactive-link">{{\'APPLICATION_VISITOR\' | translate}}</a>\n                                                         <hr>\n                                                  </h3>\n                                                 <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-user"></i>\n                                                             <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.fullname}}</a>\n                                                       </div>\n                                                        <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-envelope"></i>\n                                                         <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.email}}</a>\n                                                  </div>\n                                                        <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-globe"></i>\n                                                            <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.remote_address}}</a>\n                                                 </div>\n                                                        <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-home"></i>\n                                                             <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.referer}} - {{chatRoom.ChatVisitor.ChatWebsite.name}}</a>\n                                                    </div>\n                                                        <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-cursor"></i>\n                                                           <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.browser}}</a>\n                                                        </div>\n                                                        <div class="margin-top-20 profile-desc-link">\n                                                         <i class="icon-screen-desktop"></i>\n                                                           <a href="#" class="inactive-link">{{chatRoom.ChatVisitor.os}}</a>\n                                                     </div>\n                                                </div>\n                                        </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\n'),a.put("app/channels/chat/online/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n     <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-puzzle"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-bubble"></i>\n                                   <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-login"></i>\n                                    <a href="/channels/chat/online/list">Online</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET MAIN -->\n                 <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/enquiry.png" class="img-responsive">\n                            </div>\n                                <!-- END SIDEBAR USERPIC -->\n                          <!-- START USER TITLE -->\n                             <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{chatRoom.ChatVisitor.email}}\n                                        </div>\n                                        <div class="profile-usertitle-job">\n                                           {{chatRoom.ChatVisitor.fullname}}\n                                     </div>\n                                </div>\n                                <!-- END USER TITLE -->\n                               <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.channels.chat.online.view.detail\')}">\n                                                   <a data-ng-href="/channels/chat/online/view/{{chatRoom.id}}/detail">\n                                                  <i class="icon-tag"></i>\n                                                      {{ \'APPLICATION_DETAIL\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET MAIN -->\n             </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view class="profile-content">\n         </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/preview/preview.html",'<style>\n.xc_header_logo\n{\n      display:block;\n  background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/motion_logo.png);\n    width:40px;\n   height:40px;\n  float:left;;\n  margin-left: 10px !important;\n  margin-top: 6px !important;\n}\n.xc_rating {\n  text-align: center;\n}\n.xc_rating_label > input{ /* HIDE RADIO */\n  display:none;\n}\n.xc_rating_label > input + img{ /* IMAGE STYLES */\n  cursor:pointer;\n  border:2px solid transparent;\n}\n.xc_rating_label > input:checked + img{ /* (CHECKED) IMAGE STYLES */\n  /*border:2px solid #f00;*/\n  background-color: #efefef;\n}\n\n.xc_label {\n  display: inline-block;\n  max-width: 100%;\n  margin-bottom: 5px;\n  font-weight: bold;\n}\n\n.xc_online_message,\n.xc_offline_message,\n.xc_rating_message\n{\n  text-align: center;\n}\n\n.xc_div_group {\n  margin: 10px 0 10px 0;\n}\n.xc_footer\n{\n  text-align: center;\n  padding-bottom: 5px;\n}\n\n.xc_powered\n{\n  color: grey;\n  font: 10px/16px "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;\n  padding-bottom: 5px;\n}\n\n.xc_chat_container\n{\n  //width:379px;\n  //position:fixed;\n  //bottom:0;\n  //right:50px;\n  z-index:9999;\n  background-color:transparent;\n}\n\n.xc_chat_container *\n{\n  font-family:Arial,Helvetica,sans-serif;\n  font-size:13px;\n  margin:0;\n  padding:0;\n}\n\n.xc_chat_container p\n{\n  margin:5px 0;\n}\n\n.xc_signup_wrapper\n{\n  max-height:375px;\n}\n\n.xc_conversation_container\n{\n  max-height:375px;\n  list-style:none;\n  overflow:auto;\n  margin:0;\n  padding:20px 10px;\n}\n\n.xc_conversation_container a\n{\n  color:#036;\n}\n\n.xc_conversation_container a.xc_btn_style\n{\n  color:#fff;\n}\n\ndiv.xc_chat_head\n{\n  color:#fff;\n  background:{{chatWebsite.color}};\n  //border-radius: 20px 20px 0px 0px !important;\n  height:52px;\n  line-height:55px;\n  cursor:pointer;\n}\n\ndiv.xc_chat_head.rounded\n{\n  border-radius: 20px 20px 0px 0px !important;\n}\n\ndiv.xc_chat_head.squared\n{\n  //border-radius: 20px 20px 0px 0px !important;\n}\n\n.xc_chat_head-title\n{\n  margin:5px 0 0 15px;\n  color: #fff;\n}\n\n.xc_header_icon\n{\n  display:block;\n  background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/iconVisitorchat.png);\n  width:21px;\n  height:16px;\n  float:right;\n  margin:20px 20px 0 0;\n}\n\n.xc_header_icon span.xc_notification_badge span\n{\n  display:block;\n  height:16px;\n  width:15px;\n  text-align:center;\n  font-size:9px;\n  color:#555;\n  position:relative;\n  top:-20px;\n  left:4px;\n  margin:0;\n  padding:0;\n}\n\n.xc_sub-head-spacer\n{\n  padding:1px;\n}\n\n.xc_conversation\n{\n  display:none;\n  margin:0 12px 0 11px;\n}\n\n.xc_chat_toggle_container\n{\n  /*background:mediumslateblue center 52px;*/\n  background: white;\n  border-style: solid;\n  border-width: 1px;\n  border-color: {{chatWebsite.color}};\n  //display:none;\n}\n\n.xc_signup_wrapper,.xc_notifications_wrapper,.xc_enquiry_wrapper,.xc_rating_wrapper\n{\n  //display:none;\n  display:block;\n  overflow:auto;\n  line-height:1;\n  padding:25px;\n}\n\n.xc_exit_chat_container\n{\n  text-align:right;\n  width:95%;\n  margin:0 auto;\n  padding:5px 1px 0 0;\n}\n\n.xc_exit_chat_container span,.xc_exit_chat_container a\n{\n  font-size:80%;\n  color:#666;\n  text-decoration:none;\n}\n\n.xc_exit_chat_container a:hover\n{\n  color:#333;\n}\n\na.xc_btn_exit_chat_confirm:hover\n{\n  color:red;\n}\n\na.xc_btn_exit_chat_cancel:hover\n{\n  color:#0c0;\n}\n\nform.xc_form_reply\n{\n  position:relative;\n}\n\n.xc_form_reply\n{\n  /*background-color:#e3e3e3;*/\n  text-align:center;\n  /*border-top:1px solid #d3d3d3;*/\n}\n\n.xc_input_message\n{\n  height:100px;\n  margin:10px auto 5px;\n}\n\n.xc_input_enquiry_message,\n.xc_input_rating_message\n{\n  height:100px;\n}\n\n.xc_form_signup,.xc_form_enquiry,.xc_form_rating\n{\n  /*text-align:center;*/\n}\n\n.xc_chat_container textarea,.xc_chat_container input[type=text]\n{\n  width:95%;\n  min-width:95%;\n  max-width:95%;\n  -webkit-box-sizing:border-box;\n  -moz-box-sizing:border-box;\n  box-sizing:border-box;\n  background-color:#fff;\n  border:1px solid #ccc;\n  -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);\n  -webkit-transition:border linear .2s, box-shadow linear .2s;\n  -moz-transition:border linear .2s, box-shadow linear .2s;\n  -o-transition:border linear .2s, box-shadow linear .2s;\n  transition:border linear .2s, box-shadow linear .2s;\n  display:inline-block;\n  font-size:14px;\n  line-height:20px;\n  color:#555;\n  -webkit-border-radius:4px;\n  -moz-border-radius:4px;\n  border-radius:4px;\n  vertical-align:middle;\n  margin:3px 0;\n  padding:4px 6px;\n  resize: none;\n}\n\n.xc_chat_container textarea:focus,.xc_chat_container input[type=text]:focus\n{\n  outline: {{chatWebsite.color_focus}} auto 5px;\n}\n\n.xc_chat_container input[type=text]\n{\n  height: 30px;\n}\n\n.xc_message_sending textarea, .xc_enquiry_sending textarea\n{\n  background: #fff url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/loading.gif) 98% 5px no-repeat;\n}\n\n.xc_chatrow\n{\n  display:block;\n  border-top:1px dashed #e3e3e3;\n  margin:5px 0;\n  clear: both;\n}\n\n.xc_chatrow p\n{\n  color:#444;\n  word-wrap:break-word;\n}\n\n.xc_time\n{\n  float:right;\n  font-size:80%;\n  color:#ccc;\n  padding-left:12px;\n  margin:3px;\n}\n\n.xc_submission_pending\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_clock.png) left center norepeat;\n}\n\n.xc_submission_confirmed\n{\n  background:transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_tick.png) left center norepeat;\n}\n\n.xc_fullname\n{\n  font-weight:700;\n}\n\n.xc_fullname:after\n{\n  content:":";\n}\n\n.xc_avatar\n{\n  float: left;\n  margin: 0 5px 5px 0;\n  display: inline-block;\n  width: 40px;\n  height: 40px;\n  border-radius: 5px;\n  -moz-border-radius: 5px;\n  -webkit-border-radius: 5px;\n}\n\n.xc_smilie\n{\n  background-repeat:no-repeat;\n  display:inline-block;\n  width:18px;\n  height:18px;\n  text-indent:-9999px;\n  white-space:nowrap;\n}\n\n.xc_btn_load_more\n{\n  width:100%!important;\n}\n\n.xc_notifications_wrapper\n{\n  text-shadow:0 1px 0 rgba(255,255,255,0.5);\n}\n\n.xc_notification_success\n{\n  color:#468847;\n}\n\n.xc_notification_error\n{\n  color:#b94a48;\n}\n\n.xc_errorlist\n{\n  margin:0 0 0 25px;\n  padding:0;\n}\n\ni.xc_btn_notifications_close\n{\n  float:right;\n  font-weight:700;\n  font-size:20px;\n  color:#ccc;\n  cursor:pointer;\n  margin:-15px 0 0;\n  padding:0;\n}\n\n.xc_btn_style\n{\n  width:95%;\n  text-align:center;\n  line-height:1.2;\n  font-size:90%;\n  -moz-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  -webkit-box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  box-shadow:inset 0 1px 0 0 {{chatWebsite.color_button}};\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  -moz-border-radius:4px;\n  -webkit-border-radius:4px;\n  border-radius:4px;\n  border:1px solid {{chatWebsite.color_button}};\n  display:inline-block;\n  color:#fff;\n  font-weight:700;\n  text-decoration:none;\n  text-shadow:1px 1px 0 #000c17;\n  margin:0 auto 5px;\n  padding:2px 0;\n}\n\n.xc_btn_style:hover\n{\n  background:0;\n  background-color:{{chatWebsite.color_button}};\n  color: #fff;\n  text-decoration: none;\n}\n\n.xc_btn_style:active\n{\n  position:relative;\n  top:1px;\n}\n\n.xc_composing_container\n{\n  display: none;\n  width: 95%;\n  margin: 0 auto;\n  background: transparent url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/bullet_pencil.png) 6px center no-repeat;\n  padding-left: 19px;\n  font-style: italic;\n}\n\n@media only screen and (max-height: 620px) {\n  .xc_conversation_container\n  {\n    max-height:300px!important;\n  }\n}\n\n@media only screen and (max-height: 545px) {\n  .xc_conversation_container\n  {\n    max-height:200px!important;\n  }\n}\n\n@media only screen and (max-height: 445px) {\n  .xc_conversation_container\n  {\n    max-height:150px!important;\n  }\n}\n\n@media only screen and (max-width: 480px) {\n  .xc_chat_container\n  {\n    width:95%!important;\n    right:auto!important;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    box-shadow:0 0 5px rgba(0,0,0,.5);\n    -webkit-box-shadow:0 0 5px rgba(0,0,0,.5);\n    -moz-box-shadow:0 0 5px rgba(0,0,0,.5);\n  }\n\n  div.xc_chat_head\n  {\n    background-color:#036;\n    background-image:none;\n    line-height:25px;\n    height:auto;\n    -webkit-border-top-left-radius:15px;\n    -webkit-border-top-right-radius:15px;\n    -moz-border-radius-topleft:15px;\n    -moz-border-radius-topright:15px;\n    border-top-left-radius:15px;\n    border-top-right-radius:15px;\n    padding:10px;\n  }\n\n  .xc_chat_toggle_container\n  {\n    background-color:#fff;\n    background-image:none;\n    border-color:#036;\n    border-style:solid;\n    border-width:0 1px;\n  }\n\n  .xc_header_icon\n  {\n    background-image:url({{chatWebsite.remote}}/api/xchatty/assets?resource=images/icon_visitorchat.png);\n    margin:0;\n  }\n\n  .xc_header_icon span.xc_notification_badge span\n  {\n    top:-5px;\n    left:5px;\n  }\n\n  .xc_notification_success\n  {\n    background-color:#dff0d8;\n    border:1px solid #d6e9c6;\n  }\n\n  .xc_conversation_container\n  {\n    max-height:375px;\n    border-color:#036;\n  }\n\n  .xc_notification_error\n  {\n    background-color:#f2dede;\n    border:1px solid #eed3d7;\n  }\n\n  .xc_sub-head-spacer\n  {\n    display:none;\n    padding:0;\n  }\n\n  .xc_chat_head-title,.xc_conversation\n  {\n    margin:0;\n  }\n}\n</style>\n<div class="xc_chat_container">\n  <div class="xc_chat_head {{chatWebsite.header_shape}}">\n    <i class="xc_header_icon">\n      <span class="xc_notification_badge">\n        <span class="xc_notification_badge_number"></span>\n      </span>\n    </i>\n    <i class="xc_header_logo" style="background-image:url(/api/xchatty/assets?resource=images/{{(chatWebsite.defaultLogo || !license.custom) ? \'motionLogo.png\' : (!chatWebsite.defaultLogo && chatWebsite.logo && license.custom) ? chatWebsite.logo+\'&uploaded\' : \'motionLogo.png\'}});background-size:contain;"></i>\n    </a>\n    <span class="xc_chat_head-title">{{statePreview.state == \'online\' ? chatWebsite.header_online : chatWebsite.header_offline}}</span>\n  </div>\n  <div class="xc_chat_toggle_container">\n    <div class="xc_sub-head-spacer"></div>\n    <!-- <div class="xc_notifications_wrapper">\n    <ul class="xc_errorlist"></ul>\n  </div> -->\n  <div class="xc_enquiry_wrapper" data-ng-show=\'statePreview.state == "offline"\'>\n    <form class="xc_form_enquiry" accept-charset="UTF-8">\n      <p class="xc_offline_message" ng-bind-html=\'chatWebsite.offline_message\'></p>\n      <br>\n      <div ng-if="chatWebsite.enquiry_enable">\n        <div class="xc_div_group">\n          <label for="enquiryFullname" class="xc_label">{{chatWebsite.name_title}} *</label>\n          <input id="enquiryFullname" maxlength="45" data-label="Name" type="text" name="data[Enquiry][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_enquiry_fullname" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryEmail" class="xc_label">{{chatWebsite.email_title}} *</label>\n          <input id="enquiryEmail" maxlength="85" type="text" data-label="Email Address" name="data[Enquiry][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_enquiry_email" required/>\n        </div>\n        <br>\n        <div class="xc_div_group">\n          <label for="enquiryMessage" class="xc_label">{{chatWebsite.message_title}} *</label>\n          <textarea id="enquiryMessage" data-label="Message" maxlength="1500" placeholder="{{chatWebsite.enquiry_message_placeholder}}" name="data[Enquiry][message]" class="xc_input_enquiry_message" required></textarea>\n        </div>\n        <br>\n        <button type="submit" class="xc_btn_enquiry xc_btn_style">{{chatWebsite.enquiry_button}}</button>\n      </div>\n    </form>\n  </div>\n  <div class="xc_signup_wrapper" data-ng-show=\'statePreview.state == "online"\'>\n    <form class="xc_form_signup" accept-charset="UTF-8">\n      <p class="xc_online_message" ng-bind-html=\'chatWebsite.online_message\'></p>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataFullname" class="xc_label">{{chatWebsite.name_title}} *</label>\n        <input maxlength="45" id="dataFullname" data-label="Fullname" type="text" name="data[Discussion][fullname]" placeholder="{{chatWebsite.username_placeholder}}" class="xc_input_fullname" required/>\n      </div>\n      <br>\n      <div class="xc_div_group">\n        <label for="dataEmail" class="xc_label">{{chatWebsite.email_title}} *</label>\n        <input maxlength="85" id="dataEmail" data-label="Email Address" type="text" name="data[Discussion][email]" placeholder="{{chatWebsite.email_placeholder}}" class="xc_input_email" required/>\n      </div>\n      <br>\n      <input type="hidden" class="xc_input_visitor_time" name="data[Discussion][visitor_time]" />\n      <button type="submit" class="xc_btn_signup xc_btn_style">{{chatWebsite.start_chat_button}}</button>\n    </form>\n  </div>\n  <div class="xc_rating_wrapper" data-ng-show=\'statePreview.state == "rating"\'>\n    <form class="xc_form_rating" accept-charset="UTF-8">\n      <p class="xc_rating_message">{{chatWebsite.rating_message}}</p>\n      <br>\n      <div class="xc_rating">\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="good" />\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/like.png" alt="Good" height="50"/>\n        </label>\n        <label class="xc_rating_label" style="padding:30px;">\n          <input type="radio" name="data[Rating][rating]" value="bad"/>\n          <img src="{{chatWebsite.remote}}/api/xchatty/assets?resource=images/dislike.png" alt="Good" height="50"/>\n        </label>\n      </div>\n      <div class="xc_div_group">\n        <label for="ratingMessage" class="xc_label">Message</label>\n        <textarea id="ratingMessage" data-label="Message" maxlength="1500" name="data[Rating][message]" class="xc_input_rating_message"></textarea>\n      </div>\n      <button type="submit" class="xc_button_rating xc_btn_style">{{chatWebsite.rating_send}}</button>\n      <button type="button" class="xc_button_skip_rating xc_btn_style">{{chatWebsite.rating_skip}}</button>\n    </form>\n  </div>\n  <div class="xc_footer">\n    <div data-ng-if="chatWebsite.defaultWhiteLabel || !license.custom" class="xc_powered"><a>Powered by xCALLY</a></div>\n              <div data-ng-if="!chatWebsite.defaultWhiteLabel && license.custom" data-ng-bind-html="chatWebsite.whiteLabel"></div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/queue/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.name.$touched || form.$submitted) && form.name.$invalid}">\n      <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.name" data-ng-pattern="settings.patternName" required />\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$invalid && form.name.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.name.$invalid && form.name.$error.pattern" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n      </span>\n    </div>\n    <!-- END NAME -->\n\n    <!-- START STRATEGY -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.strategy.$touched || form.$submitted) && form.strategy.$invalid}">\n      <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.strategy" name="strategy" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'beepall\',\'roundrobin\',\'rrmemory\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.strategy.$touched || form.$submitted) && form.strategy.$invalid && form.strategy.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END STRATEGY -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.timeout.$touched || form.$submitted) && form.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_AGENT_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="Timeout" class="form-control" data-ng-model="item.timeout" required min="1"/>\n      <span data-ng-show="(form.timeout.$touched || form.$submitted) && form.timeout.$invalid && form.timeout.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TIMEOUT -->\n\n    <!-- START AGENTS-->\n    <div class="form-body" data-ng-init="getTeams()">\n      <label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n      <div class="input-group input-small mbottom20">\n        <input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="item.penalty" readonly>\n        <div class="spinner-buttons input-group-btn btn-group-vertical">\n          <button type="button" class="btn spinner-up btn-xs blue" data-ng-click="item.penalty=item.penalty+1">\n            <i class="fa fa-angle-up"></i>\n          </button>\n          <button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!item.penalty" data-ng-click="item.penalty=item.penalty-1">\n            <i class="fa fa-angle-down"></i>\n          </button>\n        </div>\n      </div>\n      <div class="form-group last">\n        <div class="col-md-12" id="multi-select-team">\n        </div>\n      </div>\n    </div>\n    <!-- END AGENTS-->\n\n    <!-- START DESCRIPTION -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n    </div>\n    <!-- END DESCRIPTION -->\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/queue/list/list.html",'<div class="row">\n   <div class="col-md-12">\n                       <div class="page-bar">\n                                <ul class="page-breadcrumb">\n                                  <li>\n                                          <i class="icon-rocket"></i>\n                                           <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                           <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-puzzle"></i>\n                                           <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-bubble"></i>\n                                           <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                                <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-docs"></i>\n                                             <a href="#">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n                                      </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n       <div class="col-md-12">\n               <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initView()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_QUEUES\' | translate }}</a> </span>\n                            </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="id.length">\n                                              <a class="btn red" href="#" data-ng-click="deleteItems()">\n                                                    <i class="icon-trash"></i> {{ \'APPLICATION_DELETE\' | translate }}\n                                           </a>\n                                  </div>\n                                        <a class="btn green-jungle" href="#" data-ng-click="createItem()" data-ng-if="Auth.isAdmin()">\n                                                <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | translate }}\n                                 </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                                  <div class="watermark" ng-show="!gridOptions.data.length">{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</div>\n                            </div>\n                                <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/queue/view/view.agents.html",'<div class="row" data-ng-init="getTeams()">\n       <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_AGENTS\' | translate}}</span>\n                          </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- BEGIN FORM-->\n                            <form action="index.html" class="form-horizontal form-row-seperated">\n                                 <div class="form-body">\n                                               <label for="penalty">{{\'APPLICATION_PENALTY\' | translate}}</label>\n                                          <div class="input-group input-small mbottom20">\n                                                       <input type="number" class="spinner-input form-control" maxlength="3" data-ng-model="queue.penalty" readonly>\n                                                 <div class="spinner-buttons input-group-btn btn-group-vertical">\n                                                              <button type="button" class="btn spinner-up btn-xs blue" data-ng-click="queue.penalty=queue.penalty+1">\n                                                                       <i class="fa fa-angle-up"></i>\n                                                                </button>\n                                                             <button type="button" class="btn spinner-down btn-xs blue" data-ng-disabled="!queue.penalty" data-ng-click="queue.penalty=queue.penalty-1">\n                                                                   <i class="fa fa-angle-down"></i>\n                                                              </button>\n                                                     </div>\n                                                </div>\n                                                <div class="form-group last">\n                                                 <div class="col-md-12" id="multi-select-team">\n                                                        </div>\n                                                </div>\n                                        </div>\n                                </form>\n                               <!-- END FORM-->\n                      </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/queue/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getQueue()">\n    <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-bubble"></i>\n                                   <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/chat/queues/list">{{ \'APPLICATION_QUEUES\' | translate }}</a>\n                                     <i data-ng-show="queue" class="fa fa-angle-right"></i>\n                                </li>\n                         <li data-ng-show="queue">\n                                     <a href="#">{{queue.name}}</a>\n                                </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET MAIN -->\n                 <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/queue.png" class="img-responsive">\n                              </div>\n                                <!-- END SIDEBAR USERPIC -->\n                          <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{queue.name}}\n                                        </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.settings\')}">\n                                                 <a data-ng-href="/channels/chat/queues/view/{{queue.id}}/settings">\n                                                   <i class="icon-settings"></i>\n                                                 {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n                                                </li>\n                                         <li data-ng-class="{active: $state.is(\'main.channels.chat.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                   <a data-ng-href="/channels/chat/queues/view/{{queue.id}}/agents">\n                                                     <i class="icon-people"></i>\n                                                   {{ \'APPLICATION_AGENTS\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET MAIN -->\n             </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view class="profile-content">\n         </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/chat/queue/view/view.settings.html",'<div class="row">\n   <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\n                             <div class="caption caption-md">\n                                      <i class="icon-globe theme-font hide"></i>\n                                    <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_SETTINGS\' | translate}}</span>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.general" data-ng-submit="forms.general.$valid && updateChatQueue()" novalidate>\n                                     <!-- START NAME -->\n                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid}">\n                                            <label class="control-label">{{\'APPLICATION_NAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                         <input type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="queue.name" data-ng-pattern="settings.patternName" required />\n                                          <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.required" class="help-block help-block-error">\n                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                               <span data-ng-show="(forms.general.name.$touched || forms.general.$submitted) && forms.general.name.$invalid && forms.general.name.$error.pattern" class="help-block help-block-error">\n                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_NAME\' | translate}}.\n                                           </span>\n                                       </div>\n                                        <!-- END NAME -->\n\n                                   <!-- START STRATEGY -->\n                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.general.strategy.$touched || forms.general.$submitted) && forms.general.strategy.$invalid}">\n                                            <label class="control-label">{{\'APPLICATION_STRATEGY\' | translate}}</label>\n                                         <ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap">\n                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n                                                       <ui-select-choices repeat="strategy in [\'beepall\',\'roundrobin\',\'rrmemory\'] | filter: $select.search">\n                                                           <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n                                                 </ui-select-choices>\n                                          </ui-select>\n                                  </div>\n                                        <!-- END STRATEGY -->\n\n                                       <!-- START TIMEOUT -->\n                                        <div class="form-group">\n                                              <label class="control-label">{{\'APPLICATION_AGENT\' | translate}} {{\'APPLICATION_TIMEOUT\' | translate}}</label>\n                                            <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" min="1" data-ng-model="queue.timeout"/>\n                                        </div>\n                                        <!-- END TIMEOUT -->\n\n                                        <!-- START DESCRIPTION -->\n                                    <div class="form-group">\n                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                              <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="queue.description"/>\n                                      </div>\n                                        <!-- END DESCRIPTION -->\n\n                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                          </form>\n                       </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/agent.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n        <div class="col-md-12">\n               <!-- START TABLE -->\n          <div ui-grid="gridOptions"  ui-grid-resize-columns  class="ui-grid" ui-grid-tree-view ui-grid-expandable-row ui-grid-pagination ui-grid-auto-resize>\n                  <span us-spinner spinner-key="grid-spinner" spinner-start-active="true"></span>\n                       <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n              </div>\n                <!-- END TABLE -->\n    </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INTERFACE_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n<div data-ng-if="agent.ipaddr" class="well">\n  <div>{{agent.ipaddr}}:{{agent.port}}</div>\n  <div>{{agent.fullcontact}}</div>\n  <div>{{agent.useragent}}</div>\n  <div>{{agent.lastms}}</div>\n</div>\n<div data-ng-if="!agent.ipaddr" class="alert alert-danger" role="alert">\n  {{\'MESSAGE_NO_AVAILABLE_INFO\' | translate}}\n</div>\n</div>\n<div class="modal-footer">\n  <button class="btn default" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/agent/queue.modal.add.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_JOIN_QUEUE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <div class="form-group row">\n  <label class="col-md-2 control-label" style="margin-top: 7px;">{{\'APPLICATION_QUEUE\' | translate}}:</label>\n  <div class="col-md-10">\n    <ui-select multiple ng-model="item.queues" theme="bootstrap" required>\n      <ui-select-match placeholder="{{\'APPLICATION_QUEUE\' | translate}}">{{$item.name}}</ui-select-match>\n      <ui-select-choices repeat="queue.id as queue in queues | filter: $select.search">\n        <div ng-bind-html="queue.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n</div>\n\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="save()" ng-disabled="form.$invalid">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/realtime/view/application/application.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initApplications()">\n      <div class="col-md-12">\n               <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-resize-columns class="ui-grid" ui-grid-auto-resize>\n                        <div class="watermark" ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n              </div>\n                <!-- END TABLE -->\n    </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/realtime/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n <div class="col-md-12">\n               <div class="page-bar">\n                        <ul class="page-breadcrumb">\n                          <li>\n                                  <i class="icon-rocket"></i>\n                                   <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-puzzle"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-bubble"></i>\n                                   <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-energy"></i>\n                                   <a href="#">{{ \'APPLICATION_REALTIME\' | translate }}</a>\n                            </li>\n                 </ul>\n         </div>\n\n              <div>\n                 <nav class="navbar navbar-default" role="navigation">\n                         <div class="collapse navbar-collapse">\n                                        <ul class="nav navbar-nav">\n                                           <li data-ng-class="{\'active\': $state.is(\'main.channels.chat.realtime.view.agents\')}">\n                                                     <a href="/channels/chat/realtime/view/agents">\n                                                                {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.chat.realtime.view.applications\')}">\n                                                       <a href="/channels/chat/realtime/view/applications">\n                                                          {{\'APPLICATION_APPLICATIONS\' | translate}}\n                                                  </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                        </nav>\n                </div>\n\n              <div ui-view></div>\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/room/external/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n       <div class="portlet light" data-ng-init="initView()">\n         <div class="portlet-title">\n   <div class="caption">\n         <div class="btn-group btn-group-solid">\n                       <button type="button" class="btn btn-sm default" data-ng-model="query.status" uib-btn-radio="\'OPEN\'" uib-uncheckable>OPEN</button>\n          </div>\n                <div class="btn-group btn-group-solid">\n                       <button type="button" class="btn btn-sm default" data-ng-model="query.status" uib-btn-radio="\'CLOSED\'" uib-uncheckable>CLOSED</button>\n              </div>\n        </div>\n        <div class="actions">\n         <a href="#" class="btn btn-icon-only blue" data-ng-click="tagItems();" data-ng-show="id.length">\n                      <i class="fa fa-tags"></i>\n            </a>\n          <a href="#" class="btn btn-icon-only default" data-ng-click="getPage();">\n                     <i class="fa fa-refresh"></i>\n         </a>\n  </div>\n</div>\n<div class="portlet-title" data-ng-show="tags.length">\n        <!-- START TAGS -->\n   <div class="form-group">\n              <div class="row">\n                     <div class="col-md-1">\n                                <a href="#" class="btn btn-icon-only">\n                                        <i class="fa fa-tags" style="color: gray;"></i>\n                               </a>\n                  </div>\n                        <div class="col-md-11">\n                               <ui-select multiple data-ng-model="query.tags" theme="bootstrap" on-select="onChanged($item, $model)" on-remove="onChanged($item, $model)">\n                                   <ui-select-match placeholder="Search by tag...">{{$item}}</ui-select-match>\n                                   <ui-select-choices repeat="tag in tags | filter:$select.search">\n                                              {{tag}}\n                                       </ui-select-choices>\n                          </ui-select>\n                  </div>\n                </div>\n        </div>\n        <!-- END TAGS -->\n</div>\n<div class="portlet-body">\n         <!-- BEGIN UI-GRID SPINNER -->\n                <span us-spinner spinner-key="spinner-grid" spinner-start-active="true"></span>\n               <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n\n                <div ui-grid="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-selection ui-grid-pagination class="ui-grid">\n                   <div class="watermark" data-ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n         </div>\n                <!-- END TABLE -->\n    </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/room/group/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n  <div class="portlet light" data-ng-init="initView()">\n         <div class="portlet-title">\n   <div class="caption">\n         <div class="btn-group btn-group-solid">\n                       <button type="button" class="btn btn-sm default" data-ng-model="query.status" uib-btn-radio="\'OPEN\'" uib-uncheckable>OPEN</button>\n          </div>\n                <div class="btn-group btn-group-solid">\n                       <button type="button" class="btn btn-sm default" data-ng-model="query.status" uib-btn-radio="\'CLOSED\'" uib-uncheckable>CLOSED</button>\n              </div>\n        </div>\n        <div class="actions">\n         <a href="#" class="btn btn-icon-only default" data-ng-click="getPage();">\n                     <i class="fa fa-refresh"></i>\n         </a>\n  </div>\n</div>\n<div class="portlet-title" data-ng-show="tags.length">\n        <!-- START TAGS -->\n   <div class="form-group">\n              <div class="row">\n                     <div class="col-md-1">\n                                <a href="#" class="btn btn-icon-only">\n                                        <i class="fa fa-tags" style="color: gray;"></i>\n                               </a>\n                  </div>\n                        <div class="col-md-11">\n                               <ui-select multiple data-ng-model="query.tags" theme="bootstrap" on-select="onChanged($item, $model)" on-remove="onChanged($item, $model)">\n                                   <ui-select-match placeholder="Search by tag...">{{$item}}</ui-select-match>\n                                   <ui-select-choices repeat="tag in tags | filter:$select.search">\n                                              {{tag}}\n                                       </ui-select-choices>\n                          </ui-select>\n                  </div>\n                </div>\n        </div>\n        <!-- END TAGS -->\n</div>\n<div class="portlet-body">\n         <!-- BEGIN UI-GRID SPINNER -->\n                <span us-spinner spinner-key="spinner-grid" spinner-start-active="true"></span>\n               <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n\n                <div ui-grid="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination class="ui-grid">\n                     <div class="watermark" data-ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n         </div>\n                <!-- END TABLE -->\n    </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/room/internal/list/list.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n    <div class="col-md-12" data-ng-init="initView()">\n             <!-- BEGIN UI-GRID SPINNER -->\n                <span us-spinner spinner-key="spinner-grid" spinner-start-active="true"></span>\n               <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination class="ui-grid">\n                     <div class="watermark" data-ng-show="!gridOptions.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n         </div>\n                <!-- END TABLE -->\n    </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/room/room.add.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 class="modal-title">{{\'APPLICATION_NEW_GROUP\' | translate}}</h4>\n</div>\n\n<div class="modal-body">\n  <div class="portlet box blue">\n            <div class="portlet-title">\n                   <div class="caption">\n                         <i class="icon-people"></i>{{\'APPLICATION_AGENTS\' | translate}}\n                     </div>\n                </div>\n                <div class="portlet-body">\n                    <ul>\n                          <li data-ng-repeat="item in items">\n                                    {{item.fullname}}\n                            </li>\n        <li data-ng-repeat="item in selected.items">\n                                    {{item.fullname}}\n                            </li>\n                 </ul>\n         </div>\n        </div>\n\n  <ui-select multiple name="items" ng-model="selected.items" theme="bootstrap">\n    <ui-select-match placeholder="{{\'APPLICATION_SELECTED_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n    <ui-select-choices repeat="{id: agent.id, fullname: agent.fullname} as agent in agents.rows | filter: $select.search">\n      {{agent.fullname}}\n    </ui-select-choices>\n  </ui-select>\n</div>\n\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="selected.items.length">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/chat/room/room.close.html",'<div class="modal-header">\n  <button ng-if="modal.dismissable" type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <h4 ng-if="modal.title" ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p ng-if="modal.text && !closed" ng-bind="modal.text | translate"></p>\n  <form name="form" novalidate data-ng-init="initDisposition()">\n  <div class="form-group">\n    <ui-select data-ng-model="item.disposition" name="list" theme="bootstrap" data-ng-disabled="!dispositions.length" required>\n      <ui-select-match placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}">{{$select.selected.name}}</ui-select-match>\n      <ui-select-choices repeat="disposition.name as disposition in dispositions | filter: $select.search">\n        <div ng-bind-html="disposition.name | highlight: $select.search"></div>\n      </ui-select-choices>\n    </ui-select>\n  </div>\n  <div class="note note-warning" data-ng-hide="dispositions.length">\n    <h4 class="block">Warning!</h4>\n    <p>\n      {{ \'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate }}\n    </p>\n  </div>\n</form>\n  <!-- <div ng-if="modal.html" ng-bind-html="modal.html"></div> -->\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n  <!-- <button ng-repeat="button in modal.buttons" ng-class="button.classes" ng-click="button.click($event)" ng-bind="button.text" class="btn"></button> -->\n</div>\n'),a.put("app/channels/chat/room/room.directive.html",'<div class="portlet light">\n  <div class="portlet-title">\n    <div class="caption">\n      <span data-ng-if="chatRoom" class="label label-sm label-default">{{chatRoom.status}}</span>\n      <span data-ng-if="chatRoom.ChatWebsite"> | </span>\n      <span data-ng-if="chatRoom.ChatWebsite" class="caption-subject font-green-sharp bold uppercase">{{chatRoom.ChatWebsite.name | truncate: 25: \'...\': true}}</span>\n    </div>\n    <div class="actions">\n      <button class="btn btn-icon-only btn-primary" data-ng-click="addAgent(chatRoom.id)" data-ng-disabled="chatRoom.status === \'CLOSED\'">\n        <i class="fa fa-user-plus"></i>\n      </button>\n      <button class="btn btn-icon-only" data-ng-class="{\'btn-success\':chatRoom.status !== \'CLOSED\',\'grey-cascade\':chatRoom.status === \'CLOSED\'}" data-ng-click="closeRoom(chatRoom.id)" data-ng-if="chatRoom.ChatVisitors.length" data-ng-disabled="chatRoom.status === \'CLOSED\' && chatRoom.disposition">\n        <i data-ng-class="{\'fa fa-upload\':chatRoom.status !== \'CLOSED\',\'icon-target\':chatRoom.status === \'CLOSED\'}"></i>\n      </button>\n      <a href="api/chat/rooms/{{chatRoom.id}}/export" target="_blank" class="btn btn-primary btn-icon-only" data-ng-if="chatRoom" title="{{\'APPLICATION_EXPORT\' | translate}} CSV">\n        <i class="fa fa-download"></i>\n      </a>\n      <button class="btn default btn-icon-only" data-ng-if="chatRoom && chatRoom.status !== \'CLOSED\'" data-ng-click="togglePanelLeft()" title="{{\'APPLICATION_RESIZE\' | translate}}">\n        <i ng-class="panelRight == \'col-md-12\' ? \'icon-size-actual\' : \'icon-size-fullscreen\'"></i>\n      </button>\n    </div>\n  </div>\n  <div class="portlet-body">\n<div class="row">\n  <div data-ng-class="panelLeft" data-ng-show="panelLeft">\n    <div class="portlet">\n      <div class="portlet-body">\n        <div class="portlet-title line">\n          <div class="form">\n            <!-- START TAGS -->\n            <div class="form-group">\n              <div class="row">\n                <div class="col-md-1">\n                  <a href="#" class="btn btn-icon-only">\n                    <i class="fa fa-tags" style="color: gray;"></i>\n                  </a>\n                </div>\n                <div class="col-md-11">\n                  <ui-select multiple data-ng-model="form.tags" theme="bootstrap" on-select="onChanged(chatRoom.id)" on-remove="onChanged(chatRoom.id)">\n                    <ui-select-match placeholder="Tags...">{{$item}}</ui-select-match>\n                    <ui-select-choices repeat="tag in tags | filter:$select.search" class="">\n                      {{tag}}\n                    </ui-select-choices>\n                  </ui-select>\n                </div>\n              </div>\n            </div>\n            <!-- END TAGS -->\n          </div>\n        </div>\n        <v-accordion class="vAccordion--default">\n          <v-pane data-ng-if="chatRoom.ChatVisitors.length" data-ng-repeat="chatVisitor in chatRoom.ChatVisitors" expanded="true">\n            <v-pane-header>\n              <ng-letter-avatar\n              height="40"\n              width="40"\n              data="{{chatRoom.ChatVisitor.fullname}}"\n              fontsize="25"\n              avatarcustombgcolor="#B0B0B0"\n              charCount="2"\n              avatarcustomborder="border:2px solid #EA4C61"\n              shape="round"></ng-letter-avatar>\n            </v-pane-header>\n            <v-pane-content>\n              {{\'APPLICATION_ROOM_ID\' | translate}}: <p>{{chatRoom.id}}</p>\n              {{\'APPLICATION_NAME\' | translate}}: <p>{{chatRoom.ChatVisitor.fullname}}</p>\n              {{\'APPLICATION_EMAIL\' | translate}}: <p><a data-ng-click="openContact(chatRoom.ChatVisitor.email)" href="">{{chatRoom.ChatVisitor.email}}</a></p>\n              <span data-ng-if="chatRoom.ChatVisitor.labelData1">{{chatRoom.ChatVisitor.labelData1}}: <p>{{chatRoom.ChatVisitor.data1}}</p></span>\n              <span data-ng-if="chatRoom.ChatVisitor.labelData2">{{chatRoom.ChatVisitor.labelData2}}: <p>{{chatRoom.ChatVisitor.data2}}</p></span>\n              <span data-ng-if="chatRoom.ChatVisitor.labelData3">{{chatRoom.ChatVisitor.labelData3}}: <p>{{chatRoom.ChatVisitor.data3}}</p></span>\n              {{\'APPLICATION_REMOTE_ADDRESS\' | translate}}: <p>{{chatRoom.ChatVisitor.remote_address}}</p>\n              {{\'APPLICATION_BROWSER\' | translate}}: <p>{{chatRoom.ChatVisitor.browser}}</p>\n              {{\'APPLICATION_REFERER\' | translate}}:<p>{{chatRoom.ChatVisitor.referer}} - {{enquiry.ChatWebsite.name}}</p>\n              {{\'APPLICATION_OS\' | translate}}: <p>{{chatRoom.ChatVisitor.os}}</p>\n            </v-pane-content>\n          </v-pane>\n\n          <v-pane data-ng-repeat="user in chatRoom.Users | filter:{ id: \'!\' + user.id}">\n            <v-pane-header>\n              <ng-letter-avatar\n              height="40"\n              width="40"\n              data="{{user.fullname}}"\n              fontsize="25"\n              avatarcustombgcolor="#B0B0B0"\n              avatarcustomborder="border:2px solid #3399CC"\n              charCount="2"\n              shape="round"></ng-letter-avatar>\n            </v-pane-header>\n            <v-pane-content>\n              {{\'APPLICATION_NAME\' | translate}}: <p>{{user.fullname}}</p>\n              {{\'APPLICATION_ROLE\' | translate}}: <p>{{user.role}}</p>\n              {{\'APPLICATION_INTERNAL\' | translate}}: <p>{{user.internal}}</p>\n              {{\'APPLICATION_EMAIL\' | translate}}: <p><a data-ng-href="mailto:{{user.email}}">{{user.email}}</a></p>\n            </v-pane-content>\n          </v-pane>\n        </v-accordion>\n      </div>\n    </div>\n  </div>\n  <div data-ng-class="panelRight">\n    <div class="note note-info" data-ng-if="chatRoom && chatRoom.status == \'CLOSED\'">\n      <h4 class="block"><i class="icon-info"></i> {{\'MESSAGE_CHAT_ROOM_CLOSED\' | translate}}!</h4>\n      <p>\n        <strong>{{\'MESSAGE_CHAT_ROOM_CLOSED_DETAILS\' | translate}}.</strong>\n      </p>\n      <hr>\n      <p>\n        <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{chatRoom.disposition}}</strong>\n      </p>\n      <p>\n        <i class="icon-star"></i> {{\'APPLICATION_RATING\' | translate}}: <strong>{{chatRoom.rating | ucfirst}}</strong>\n      </p>\n      <p>\n        <i class="icon-note"></i> {{\'APPLICATION_RATING_MESSAGE\' | translate}}: <strong>{{chatRoom.ratingMessage}}</strong>\n      </p>\n      <p>\n        <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{chatRoom.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="chatRoom.updatedAt"></span>)\n      </p>\n    </div>\n    <div class="portlet light bordered">\n      <div class="portlet-body">\n        <div id="chat-box" schroll-bottom="chatRoom.ChatMessages">\n        <ul class="chats">\n          <li data-ng-repeat="message in chatRoom.ChatMessages" data-ng-class="message.UserId == user.id ? \'out\' : \'in\'">\n            <div class="avatar" data-ng-class="message.ChatVisitor ? \'pretty-avatar-v\' : \'pretty-avatar\'">\n              <ng-letter-avatar\n              data-ng-if="!message.ChatVisitor"\n              height="40"\n              width="40"\n              fontsize="25"\n              data="{{message.User.fullname}}"\n              avatarcustombgcolor="#B0B0B0"\n              avatarcustomborder="border:2px solid #3399CC"\n              charCount="2"\n              shape="round"></ng-letter-avatar>\n              <ng-letter-avatar\n              data-ng-if="message.ChatVisitor"\n              height="40"\n              width="40"\n              fontsize="25"\n              data="{{message.ChatVisitor.fullname}}"\n              avatarcustombgcolor="#B0B0B0"\n              avatarcustomborder="border:2px solid #EA4C61"\n              charCount="2"\n              shape="round"></ng-letter-avatar>\n            </div>\n            <div class="message">\n              <span class="arrow"></span>\n              <a data-ng-click="message.ChatVisitor && openContact(chatRoom.ChatVisitor.email)" class="name">{{message.User.fullname || message.ChatVisitor.fullname}} </a>\n              <span am-time-ago="message.createdAt"></span>\n              <ng-emoticons emoticons-data="message.body"></ng-emoticons>\n            </div>\n          </li>\n          <li data-ng-if="chatRoom.status === \'CLOSED\'">\n            <div class="media-body" style="text-align: center;">\n              <h5 class="media-heading"><i>{{\'MESSAGE_CHAT_CLOSED\' | translate | lowercase}}</i></h5>\n            </div>\n          </li>\n        </ul>\n      </div>\n      <div class="chat-form" data-ng-if="chatRoom && isMyRoom(chatRoom.Users)">\n        <div class="input-cont">\n          <input class="form-control" type="text" placeholder="Type a message here..." ng-enter="sendMessage()" data-ng-model="message.body" data-ng-disabled="chatRoom.status === \'CLOSED\'"/>\n        </div>\n        <div class="btn-cont">\n          <span class="arrow"></span>\n          <a href="#" class="btn blue icn-only" data-ng-disabled="chatRoom.status === \'CLOSED\'" data-ng-click="sendMessage()">\n            <i class="fa fa-check icon-white"></i>\n          </a>\n        </div>\n      </div>\n      <div class="form-group chat-canned-answer-div" data-ng-if="chatRoom.status !== \'CLOSED\'" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}">\n        <div class="row">\n          <div class="col-md-1">\n            <a href="#" class="btn btn-icon-only">\n              <i class="fa fa-magic" style="color: gray;"></i>\n            </a>\n          </div>\n          <div class="col-md-11">\n            <input type="text"\n            data-ng-model="modelOptions.selectedAnswer"\n            uib-typeahead="key for key in getAnswers($viewValue)"\n            placeholder="Canned answers.."\n            typeahead-loading="loadingLocations"\n            typeahead-no-results="noResults"\n            typeahead-on-select="onSelect($item)"\n            class="form-control">\n            <i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>\n            <div ng-show="noResults">\n              <i class="glyphicon glyphicon-remove"></i> No Results Found\n            </div>\n            <span data-ng-show="forms.compose.subject.$invalid && forms.compose.$submitted" class="help-block help-block-error">\n'+"              <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n            </span>\n          </div>\n        </div>\n\n      </div>\n    </div>\n  </div>\n</div>\n</div>\n</div>\n"),a.put("app/channels/chat/room/room.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <div class="page-bar">\n      <ul class="page-breadcrumb">\n        <li>\n          <i class="icon-rocket"></i>\n          <a href="/">{{ \'APPLICATION_DASHBOARD\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-puzzle"></i>\n          <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-bubble"></i>\n          <a href="#">{{ \'APPLICATION_CHAT\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="fa fa-users"></i>\n          <a href="#">{{ \'APPLICATION_INTERACTIONS\' | translate }}</a>\n        </li>\n      </ul>\n    </div>\n\n    <div class="row inbox">\n      <div class="col-md-2">\n        <ul class="inbox-nav margin-bottom-10">\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.room.internal\')}">\n            <a href="/channels/chat/room/internal/list" class="btn">\n              {{\'APPLICATION_INTERNAL\' | translate}}\n            </a>\n            <b></b>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.room.external\')}">\n            <a href="/channels/chat/room/external/list" class="btn">\n              {{\'APPLICATION_EXTERNAL\' | translate}}\n            </a>\n            <b></b>\n          </li>\n          <li data-ng-class="{active: $state.includes(\'main.channels.chat.room.group\')}">\n            <a href="/channels/chat/room/group/list" class="btn">\n              {{\'APPLICATION_GROUPS\' | translate}}\n            </a>\n            <b></b>\n          </li>\n        </ul>\n      </div>\n\n      <div class="col-md-10">\n        <div class="room-content">\n          <div ui-view></div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/room/template.html",'<div ng-bind-html="neText" ne-hljs></div>\n<div class="ne-video" ng-if="video.host" class="fade">\n  <div class="ne-video-preview" ng-hide="nePlayVideo || !options.video.details">\n    <div class="ne-video-thumb" ng-click="nePlayVideo=!nePlayVideo">\n      <img ng-src="{{video.thumbnail}}" alt=""/>\n      <i class="fa fa-play-circle-o"></i>\n    </div>\n    <div class="ne-video-detail">\n      <div class="ne-video-title">\n        <a ng-href="{{video.url}}">{{video.title}}</a>\n      </div>\n      <div class="ne-video-desc">\n        {{video.description}}\n      </div>\n      <div class="ne-video-stats">\n        <span><i class="fa fa-eye"></i> {{video.views}}</span>\n        <span><i class="fa fa-heart"></i> {{video.likes}}</span>\n      </div>\n    </div>\n  </div>\n  <div class="ne-video-player" ng-if="nePlayVideo || !(options.video.details)">\n    <iframe ng-src="{{video.embedSrc}}" frameBorder="0" width="{{video.width}}" height="{{video.height}}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>\n  </div>\n</div>\n<div class="ne-video" ng-if="video.basic">\n  <div class="ne-video-player">\n    <div class="player">\n      <video ng-src="{{video.basic}}" controls></video>\n    </div>\n  </div>\n</div>\n<div ng-init="neImageLong=false" ng-class="{false:\'ne-image\', true:\'ne-image ne-image-long\'}[neImageLong]"\nng-if="image.url">\n<div class="ne-image-wrapper">\n  <img ng-src="{{image.url}}" ng-click="neImageLong=!neImageLong" alt=""/>\n</div>\n</div>\n<!-- <div class="ne-pdf" ng-if="pdf.url">\n  <div class="ne-pdf-preview" ng-hide="neShowPdf">\n    <div class="ne-pdf-icon">\n      <i class="fa fa-file-pdf-o"></i>\n    </div>\n    <div class="ne-pdf-detail" >\n      <div class="ne-pdf-title">\n        <a href="">{{pdf.url}}</a>\n      </div>\n      <div class="ne-pdf-view">\n\n        <button><i class="fa fa-download"></i> <a ng-href="{{pdf.url}}" target="_blank">Download</a></button>\n        <button ng-click="neShowPdf=!neShowPdf"><i class="fa fa-eye"></i> View PDF</button>\n\n      </div>\n    </div>\n  </div>\n  <div class="ne-pdf-viewer" ng-if="neShowPdf" ng-show="neShowPdf">\n    <iframe ng-src="{{pdf.url}}" frameBorder="0"></iframe>\n  </div>\n\n</div>\n<div class="ne-audio" ng-if="audio.url">\n  <audio ng-src="{{audio.url}}" controls></audio>\n</div> -->\n'),a.put("app/channels/chat/room/view.tags.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TAGS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TAGS -->\n      <div class="form-group">\n        <ui-select multiple data-ng-model="item.tags" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_TAGS\' | translate}}">{{$item}}</ui-select-match>\n          <ui-select-choices repeat="tag in tags | filter: $select.search">\n            {{tag}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TAGS -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\n</div>\n<div class="modal-footer">\n  <button type="button" class="btn" data-ng-class="button.class" data-ng-click="button.click()"data-ng-repeat="button in modal.buttons">{{button.text | translate}}</button>\n  <!-- <button class="btn btn-success" type="button" data-ng-click="ok()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button> -->\n</div>\n'),
index b01b869..ab75f60 100644 (file)
@@ -50,7 +50,7 @@
     <![endif]-->
     <script src="app/cf8af6fa.vendor.js"></script>
 
-    <script src="app/2fcb48e4.app.js"></script>
+    <script src="app/e497baf3.app.js"></script>
 
     <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
     <!-- BEGIN CORE PLUGINS -->
index abae8cb..f8b1120 100644 (file)
@@ -1,5 +1,6 @@
 # xCALLY MOTION Changelog
 
+- * 1038d87 - 2016-09-15: update 
 - * db963f2 - 2016-09-15: fax update 
 - * e09e78d - 2016-09-15: ACW fix 
 - * 9b767de - 2016-09-15: server side app.js update 
 - * 8cb1e93 - 2016-09-08: Hidden default metrics section 
 - * 07ca80a - 2016-09-08: Check pwd pattern only when securepassword is on; Added new reports and report fields in production seed; Moved Analytics and Modules population outside firstSetup check. 
 - * 749890e - 2016-09-08: restore button in motion dialer 
-- * 4a54072 - 2016-09-08: rename interval and time column with time interval (all channels) 
 
index cd3893a..5df1948 100644 (file)
@@ -329,6 +329,16 @@ function Action(ami, io) {
                 membername: agent.name
               }));
             });
+
+            if (agent.loginInPause) {
+              actions.push({
+                action: 'QueuePause',
+                interface: util.format('%s/%s', 'SIP', agent.name),
+                paused: true,
+                reason: 'DEFAULT PAUSE'
+              });
+            }
+
             return Promise.all(actions);
           })
           .then(function(astData) {
@@ -690,8 +700,8 @@ function Action(ami, io) {
             return Agent
               .findById(action.data1)
           })
-          .then(handlePauseLogin(options, action));
-        // END HANDLE LOGING
+          // .then(handlePauseLogin(options, action));
+          // END HANDLE LOGING
 
       case 'logout':
         // START HANDLE LOGOUT