Built motion from commit 815d4b0.|0.0.141
authorDaniele Cinti <daniele.cinti@xcally.com>
Tue, 13 Sep 2016 17:01:21 +0000 (19:01 +0200)
committerDaniele Cinti <daniele.cinti@xcally.com>
Tue, 13 Sep 2016 17:01:21 +0000 (19:01 +0200)
85 files changed:
package.json
public/app/7cbb6696.app.js [moved from public/app/4089734f.app.js with 86% similarity]
public/index.html
release-notes/changelog_0.0.141.txt
server/api/chat_queue/index.js
server/api/fax_queue/index.js
server/api/mail_queue/index.js
server/api/openchannel_queue/index.js
server/api/sms_queue/index.js
server/api/trigger/trigger.controller.js
server/app.js
server/config/agi/agi.js
server/config/agi/index.js
server/config/ami/action.js
server/config/ami/acw.js
server/config/ami/agent.js
server/config/ami/call.js
server/config/ami/dial.js
server/config/ami/fax.js
server/config/ami/index.js
server/config/ami/member.js
server/config/ami/network.js
server/config/ami/queue_caller.js
server/config/ami/recording.js
server/config/ami/socket.js [new file with mode: 0644]
server/config/ami/transfer.js
server/config/ami/trunk.js
server/config/ami/user.js
server/config/ami/voice_context.js
server/config/automations/chat.js
server/config/automations/fax.js
server/config/automations/mail.js
server/config/imap/imap.js
server/config/imap/index.js
server/config/scheduler/index.js
server/config/socketio.js
server/config/tools/channelSpy.js
server/config/tools/chatRoom.js
server/config/tools/interval.js
server/config/tools/mailAccount.js
server/config/tools/mailRoom.js
server/config/tools/queueParameters.js [new file with mode: 0644]
server/config/tools/user.js
server/config/triggers/chat.js
server/config/triggers/index.js
server/config/triggers/mail.js
server/config/triggers/sms.js
server/config/triggers/util.js
server/models/action.js
server/models/chat_room.js
server/models/fax_account.js
server/models/fax_message.js
server/models/mail_account.js
server/models/mail_message.js
server/models/mail_room.js
server/models/mail_server_in.js
server/models/mail_server_out.js
server/models/network.js
server/models/report_agent.js
server/models/report_dial.js
server/models/report_mail.js
server/models/report_member.js
server/models/report_queue.js
server/models/sms_account.js
server/models/sms_message.js
server/models/square_odbc.js
server/models/square_project.js
server/models/square_recording.js
server/models/template.js
server/models/tools_action.js
server/models/tools_automation.js
server/models/tools_condition.js
server/models/tools_interval.js
server/models/tools_schedule.js
server/models/tools_sound.js
server/models/tools_trigger.js
server/models/tools_trunk.js
server/models/tools_variable.js
server/models/user.js
server/models/voice_chanspy.js
server/models/voice_context.js
server/models/voice_queue.js
server/routes.js
server/services/dashboard/index.js
server/utils/report_extraction.js

index 6ca1f97..30d4ea3 100644 (file)
@@ -12,7 +12,6 @@
     "bluebird": "^3.3.3",
     "body-parser": "~1.14.1",
     "child-process-promise": "^2.0.2",
-    "cluster-emitter": "^0.5.0-SNAPSHOT.1388501015412",
     "composable-middleware": "^0.3.0",
     "compression": "~1.6.0",
     "connect-flash": "^0.1.1",
@@ -78,7 +77,6 @@
     "socket.io-redis": "^1.0.0",
     "socketio-jwt": "^4.3.3",
     "sox": "github:gcareri/node-sox",
-    "sticky-session": "^1.1.2",
     "string-to-json": "^0.1.0",
     "tiff-to-png": "^1.0.2",
     "tiff2pdf": "^1.0.2",
similarity index 86%
rename from public/app/4089734f.app.js
rename to public/app/7cbb6696.app.js
index d89c85f..791b549 100644 (file)
@@ -14,20 +14,20 @@ return k.get().$promise.then(function(b){a.voiceMohs=b.rows,e.syncUpdates("voice
 cellTemplate:"<div>{{'APPLICATION_APPS_'+(row.entity.appType || (grid.appScope._.find(grid.appScope.$application.applications,{value:row.entity.app}) ? row.entity.app : 'custom')).toUpperCase() | translate}}</div>",enableColumnMenu:!1},{name:"appdata",headerCellFilter:"translate",displayName:"APPLICATION_ARGUMENTS",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableColumnMenu:!1},{name:"interval",headerCellFilter:"translate",displayName:"APPLICATION_TIME_INTERVAL",enableColumnMenu:!1},{name:"action",enableColumnMenu:!1,headerCellFilter:"translate",displayName:"APPLICATION_ACTION",width:125,cellClass:"ui-grid-vcenter",cellTemplate:'<div><a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))"><i class="icon-settings"></i></a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))"><i class="fa fa-trash"></i></a></div>'}],onRegisterApi:function(b){b.selection.on.rowSelectionChanged(a,function(b){b.isSelected?a.selectedRows.push(b.entity):_.pull(a.selectedRows,b.entity)}),b.selection.on.rowSelectionChangedBatch(a,function(b){b[0].isSelected?a.selectedRows=_.map(b,"entity"):a.selectedRows=[]}),b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()}),b.grid.registerDataChangeCallback(function(){x(a.gridOptions.data.length)})}},a.deleteItems=g.confirm["delete"](function(){_.remove(a.route.Applications,function(b){return _.includes(a.selectedRows,b)}),a.selectedRows=[],a.updateRoute()}),a.initRingGroup=function(){var b,c,d;return void 0===a.selectedApp?a.usersArray=[]:a.usersArray=_.map(a.route.Applications[a.selectedApp].appdata[0].split("&"),function(a){return a.split("/")[1]}),r.get().$promise.then(function(a){return b=a,s.get().$promise}).then(function(a){return c=a,t.get().$promise}).then(function(e){d=e,ComponentsDropdowns.bindUserByRole(b,c,d,function(b){a.usersArray=_.union(b,a.usersArray),void 0===a.selectedApp?(a.application.appdata[0]=null,a.application.appdata[0]=_.map(a.usersArray,function(a){return"SIP/"+a}).join("&")):(a.route.Applications[a.selectedApp].appdata[0]=null,a.route.Applications[a.selectedApp].appdata[0]=_.map(a.usersArray,function(a){return"SIP/"+a}).join("&"))},function(b){a.usersArray=_.difference(a.usersArray,b),void 0===a.selectedApp?(a.application.appdata[0]=null,a.application.appdata[0]=_.map(a.usersArray,function(a){return"SIP/"+a}).join("&")):(a.route.Applications[a.selectedApp].appdata[0]=null,a.route.Applications[a.selectedApp].appdata[0]=_.map(a.usersArray,function(a){return"SIP/"+a}).join("&"))},a.route.Applications[a.selectedApp]?a.route.Applications[a.selectedApp].appdata:null)})["catch"](function(a){console.error(a)})};var x=function(a){var b=a?30*a+120:177;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px")};a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={settings:void 0,interval:void 0},a.application={},a.interval={intType:"always",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.main={app:""}},a.$watch("interval",function(a){a&&v(a)},!0),a.updateSetAppdata=function(){a.application.variable&&a.application.value&&"Set"===a.main.app.value?a.application.appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.updateSetAppdataSettings=function(){a.application.variable&&a.application.value&&"Set"===a.main.app.value?a.route.Applications[a.selectedApp].appdata[0]=a.application.variable+"="+a.application.value:a.application.appdata[0]=null},a.$watch("main.app",function(b){if(b){var c,d,e={},f={};switch(void 0===a.selectedApp&&(a.application={appType:b.type,app:b.value,interval:a.application.interval||"*,*,*,*",appdata:[]}),b.value){case"Queue":c=l,d=m;break;case"Playback":c=m;break;case"AGI":c=n;break;case"Goto":c=o;break;case"Voicemail":c=q;break;case"Dial":switch(b.type){case"internalDial":c=r,e={controller:"all"};break;case"externalDial":c=u}}if(c)return c.get(e).$promise.then(function(b){a.items=b.rows}).then(function(){return d?d.get(f).$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){h.error(a)})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,e.path(b)},a.getIntervals=function(){return p.get().$promise.then(function(b){a.Intervals=b.rows,d.syncUpdates("interval",a.Intervals)})["catch"](function(a){h.error(a)})},a.getRoute=function(){return k.get({id:c.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications,x(a.gridOptions.data.length)})["catch"](function(a){e.path("/channels/voice/routes/internal/list")})},a.getApplication=function(){if(void 0===a.selectedApp)e.path("/channels/voice/routes/inbound/list");else{if(a.showGrid=!0,a.route.Applications[a.selectedApp].appType)a.main.app=_.find(a.$application.applications,{type:a.route.Applications[a.selectedApp].appType});else{var b=_.find(a.$application.applications,{value:a.route.Applications[a.selectedApp].app});if(b)a.main.app=b;else{a.main.app=_.find(a.$application.applications,{type:"custom"});var c=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[c],a.route.Applications[a.selectedApp].appType="custom"}}if("Set"===a.main.app.value){var d=a.route.Applications[a.selectedApp].appdata[0].split("=");a.application.variable=d[0],a.application.value=d[1]}w()}},a.openApplication=function(b){a.selectedApp=b,a.showGrid=!1,e.path("/channels/voice/routes/internal/view/"+c.id+"/applications/settings")},a.updateRoute=function(d){return a.route.exten=a.$application.checkUnderscore(a.route.exten),_.forEach(a.route.Applications,function(a){if("custom"!==a.appType)switch(a.app){case"Dial":var b;switch(a.appType){case"externalDial":b=3;break;case"internalDial":b=2;break;default:b=2}a.appdata[b]=a.appdata[b]||"",a.appdata[b]+=(_.includes(a.appdata[b],"x")?"":"x")+(_.includes(a.appdata[b],"X")?"":"X");break;case"Queue":a.appdata[1]=a.appdata[1]||"",a.appdata[1]+=(_.includes(a.appdata[1],"x")?"":"x")+(_.includes(a.appdata[1],"X")?"":"X")}}),k.update({id:a.route.id},a.route).$promise.then(function(f){a.selectedApp=void 0,h.show(b.instant("MESSAGE_WELL_DONE")+"!","success"),d&&e.path("/channels/voice/routes/internal/view/"+c.id+"/"+d)})["catch"](function(a){h.error(a)})},a.getContexts=function(){return o.get().$promise.then(function(b){a.voiceContexts=b.rows,d.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){h.error(a)})},a.deleteApp=g.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("applications")},a.goNext=function(){f.wizard().next()},a.previous=function(){f.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){d.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.internal.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/internal/view/view.html",controller:"VoiceRouteInternalViewCtrl",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.channels.voice.routes.internal.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/internal/view/view.settings.html"}).state("main.channels.voice.routes.internal.view.applications",{url:"/applications",templateUrl:"app/channels/voice/route/internal/view/view.applications.html"}).state("main.channels.voice.routes.internal.view.application",{url:"/application",templateUrl:"app/channels/voice/route/view.application.html",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.channels.voice.routes.internal.view.applications.settings",{url:"/settings",templateUrl:"app/channels/voice/route/view.applicationSettings.html",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"]})}]}})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCreateCtrl",["$scope","$uibModalInstance","Route","application","xAlert","$translate","$location","Tag",function(a,b,c,d,e,f,g,h){a.$application=d.application,a.forms={route:void 0},a.item={type:"outbound",appdata:"Outbound Call",context:"from-sip"},a.getTags=function(){return h.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){e.error(a)})},a.ok=function(){return a.item.exten=a.$application.checkUnderscore(a.item.exten),c.save(a.item).$promise.then(function(a){b.close(a),g.path("/channels/voice/routes/outbound/view/"+a.id+"/routes")})["catch"](function(a){e.error(a)})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundListCtrl",["$scope","$http","socket","$translate","$rootScope","xAlert","Modal","stResource","gridOptions","Route","$uibModal","$location","$log",function(a,b,c,d,e,f,g,h,i,j,k,l,m){a.initView=function(){var b={exporterCsvFilename:"OutboundRoutes.csv",columnDefs:[{name:"exten",displayName:"APPLICATION_DESTINATION_PATTERN"},{name:"description"},{name:"applications",cellClass:"ui-grid-vcenter",cellTemplate:'<div data-ng-if="row.entity.Applications.length"><span data-ng-repeat="app in row.entity.Applications | limitTo:2">{{app.app}}({{app.appdata[0]}}),</span>...</div><div data-ng-if="!row.entity.Applications.length">{{\'MESSAGE_NO_AVAILABLE_APPLICATIONS\' | translate}}</div>',enableSorting:!1,enableFiltering:!1,enableColumnMenu:!1},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/channels/voice/routes/outbound/view/{{row.entity.id}}/settings",name:"settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.exten, row.entity.id)"}]}]};a.gridOptions=i.gridOptions(j,b,a,{type:"outbound"})},a.create=function(){k.open({animation:!0,templateUrl:"app/channels/voice/route/outbound/list/create.modal.html",controller:"VoiceRouteOutboundListCreateCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.list",{url:"/list",templateUrl:"app/channels/voice/route/outbound/list/list.html",controller:"VoiceRouteOutboundListCtrl",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.channels.voice.routes.outbound",{url:"/outbound",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("VoiceRouteOutboundViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","WizardHandler","Modal","application","interval","Route","Trunk","VoiceContext","Interval","Tag",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(b){var c,d;if("always"===b.intType)c=null,d="*,*,*,*";else if("list"===b.intType)d=b.IntervalId?_.find(a.Intervals,{id:b.IntervalId}).name:"*,*,*,*",c=b.IntervalId||null;else if("custom"===b.intType){c=null;var e,f,g,h;e=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?(f=b.wd_from,b.wd_to&&"always"!==b.wd_to&&(f+="-"+b.wd_to)):f="*",b.md_from&&"always"!==b.md_from?(g=b.md_from,b.md_to&&"always"!==b.md_to&&(g+="-"+b.md_to)):g="*",b.m_from&&"always"!==b.m_from?(h=b.m_from,b.m_to&&"always"!==b.m_to&&(h+="-"+b.m_to)):h="*",d=e+","+f+","+g+","+h}void 0===a.selectedApp?(a.application.interval=d,a.application.IntervalId=c):(a.route.Applications[a.selectedApp].interval=d,a.route.Applications[a.selectedApp].IntervalId=c)}function q(){if(a.interval.intType=a.route.Applications[a.selectedApp].IntervalId?"list":"*,*,*,*"===a.route.Applications[a.selectedApp].interval?"always":"custom",a.interval.IntervalId=a.route.Applications[a.selectedApp].IntervalId,!a.route.Applications[a.selectedApp].IntervalId){var b,c=a.route.Applications[a.selectedApp].interval?a.route.Applications[a.selectedApp].interval.split(","):["*","*","*","*"];c.forEach(function(c,d){switch(d){case 0:"*"!==c?(b=c.split("-"),a.interval.t_from=moment(b[0],"HH:mm"),a.interval.t_to=moment(b[1],"HH:mm"),a.interval.alwaysTime=!1):(a.interval.t_from=moment(new Date),a.interval.t_to=moment(new Date),a.interval.alwaysTime=!0);break;case 1:"*"!==c?(b=c.split("-"),a.interval.wd_from=b[0],a.interval.wd_to=b[1]?b[1]:"always"):(a.interval.wd_from="always",a.interval.wd_to="always");break;case 2:"*"!==c?(b=c.split("-"),a.interval.md_from=b[0],a.interval.md_to=b[1]?b[1]:"always"):(a.interval.md_from="always",a.interval.md_to="always");break;case 3:"*"!==c?(b=c.split("-"),a.interval.m_from=b[0],a.interval.m_to=b[1]?b[1]:"always"):(a.interval.m_from="always",a.interval.m_to="always")}})}}a.$translate=c,a.selectedApp=void 0,a.showGrid=!0,a.$application=i.application,a.$interval=j.interval,a._=_,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.alwaysSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.selectedRows=[],a.gridOptions={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableSorting:!1,rowTemplate:'<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',columnDefs:[{name:"app",displayName:"APPLICATION_APPLICATION",cellClass:"ui-grid-vcenter",cellTemplate:"<div><span data-ng-if=\"row.entity.appType === 'externalDial'\">Default</span><span data-ng-if=\"row.entity.appType !== 'externalDial'\">{{row.entity.app}}</span></div>",headerCellFilter:"translate",enableColumnMenu:!1},{name:"appType",headerCellFilter:"translate",displayName:"APPLICATION_INFO",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{'APPLICATION_APPS_'+(row.entity.appType || (grid.appScope._.find(grid.appScope.$application.applications,{value:row.entity.app}) ? row.entity.app : 'custom')).toUpperCase() | translate}}</div>",enableColumnMenu:!1},{name:"appdata",displayName:"APPLICATION_ARGUMENTS",headerCellFilter:"translate",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.appdata.join(',')}}</div>",enableColumnMenu:!1},{name:"interval",displayName:"APPLICATION_TIME_INTERVAL",headerCellFilter:"translate",enableColumnMenu:!1},{name:"action",displayName:"APPLICATION_ACTION",headerCellFilter:"translate",width:125,enableColumnMenu:!1,cellClass:"ui-grid-vcenter",cellTemplate:'<div><a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.openApplication(grid.appScope.gridOptions.data.indexOf(row.entity))"><i class="icon-settings"></i></a><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteApp(row.entity.app+\' application\', grid.appScope.gridOptions.data.indexOf(row.entity))"><i class="fa fa-trash"></i></a></div>'}],onRegisterApi:function(b){b.selection.on.rowSelectionChanged(a,function(b){b.isSelected?a.selectedRows.push(b.entity):_.pull(a.selectedRows,b.entity)}),b.selection.on.rowSelectionChangedBatch(a,function(b){b[0].isSelected?a.selectedRows=_.map(b,"entity"):a.selectedRows=[]}),b.draggableRows.on.rowDropped(a,function(b,c){a.updateRoute()}),b.grid.registerDataChangeCallback(function(){r(a.gridOptions.data.length)})}},a.deleteItems=h.confirm["delete"](function(){_.remove(a.route.Applications,function(b){return _.includes(a.selectedRows,b)}),a.selectedRows=[],a.updateRoute()});var r=function(a){var b=a?30*a+120:177;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px")};a.initApplication=function(b){b&&(a.selectedApp=void 0),a.forms={info:void 0,interval:void 0},a.application={},a.interval={intType:"always",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.main={app:""},a.applications=[{name:"Default",value:"Dial",type:"outboundDial"},{name:"Custom",value:"custom",type:"custom"}]},a.$watch("interval",function(a){a&&p(a)},!0),a.$watch("main.app",function(c){if(c){var d,e;switch(void 0===a.selectedApp&&(a.application={appType:c.type,app:c.value,interval:a.application.interval||"*,*,*,*",appdata:[]}),c.value){case"Dial":d=l;break;default:d=null,e=null}if(d)return d.get().$promise.then(function(b){a.items=b.rows}).then(function(){return e?e.get().$promise:void 0}).then(function(b){b&&(a.items2=b.rows)})["catch"](function(a){b.error(a)})}},!0),a.deselectAndRedirect=function(b){a.selectedApp=void 0,f.path(b)},a.getIntervals=function(){return n.get().$promise.then(function(b){a.Intervals=b.rows,e.syncUpdates("interval",a.Intervals)})["catch"](function(a){b.error(a)})},a.getRoute=function(){return k.get({id:d.id}).$promise.then(function(b){a.route=b,a.gridOptions.data=b.Applications,r(a.gridOptions.data.length)})["catch"](function(a){f.path("/channels/voice/routes/outbound/list")})},a.getApplication=function(){if(void 0===a.selectedApp)f.path("/channels/voice/routes/outbound/list");else{if(a.showGrid=!0,a.route.Applications[a.selectedApp].appType)a.main.app=_.find(a.applications,{type:a.route.Applications[a.selectedApp].appType});else{a.main.app=_.find(a.applications,{type:"custom"});var b=a.route.Applications[a.selectedApp].appdata.join(",");a.route.Applications[a.selectedApp].appdata=[b],a.route.Applications[a.selectedApp].appType="custom"}q()}},a.openApplication=function(b){a.selectedApp=b,a.showGrid=!1,f.path("/channels/voice/routes/outbound/view/"+d.id+"/routes/settings")},a.updateRoute=function(e){return a.route.exten=a.$application.checkUnderscore(a.route.exten),_.forEach(a.route.Applications,function(a){"outboundDial"===a.appType&&(a.appdata[4]=a.appdata[4]||"",a.appdata[4]+=(_.includes(a.appdata[4],"x")?"":"x")+(_.includes(a.appdata[4],"X")?"":"X"))}),k.update({id:a.route.id},a.route).$promise.then(function(g){a.selectedApp=void 0,b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),e&&f.path("/channels/voice/routes/outbound/view/"+d.id+"/"+e)})["catch"](function(a){b.error(a)})},a.getContexts=function(){return m.get().$promise.then(function(b){a.voiceContexts=b.rows,e.syncUpdates("voice_context",a.voiceContexts)})["catch"](function(a){b.error(a)})},a.getTags=function(){return o.get().$promise.then(function(b){b.rows.unshift({name:"--"}),a.tags=b.rows})["catch"](function(a){b.error(a)})},a.deleteApp=h.confirm["delete"](function(b){a.route.Applications.splice(b,1),a.updateRoute()}),a.addApplication=function(){a.route.Applications.push(a.application),a.updateRoute("routes")},a.goNext=function(){g.wizard().next()},a.previous=function(){g.wizard().previous()},a.formValidation=function(a){return a},a.$on("destroy",function(){e.unsyncUpdates("voice_extension")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes.outbound.view",{url:"/view/:id",templateUrl:"app/channels/voice/route/outbound/view/view.html",controller:"VoiceRouteOutboundViewCtrl",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.channels.voice.routes.outbound.view.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.settings.html"}).state("main.channels.voice.routes.outbound.view.routes",{url:"/routes",templateUrl:"app/channels/voice/route/outbound/view/view.routes.html"}).state("main.channels.voice.routes.outbound.view.route",{url:"/route",templateUrl:"app/channels/voice/route/outbound/view/view.route.html"}).state("main.channels.voice.routes.outbound.view.routes.settings",{url:"/settings",templateUrl:"app/channels/voice/route/outbound/view/view.routeSettings.html"})}]),angular.module("xCallyShuttleApp").factory("Route",["$resource",function(a){return a("/api/voice/extensions/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.routes",{url:"/routes",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:7}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice",{url:"/voice",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:7}}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailListCtrl",["$scope","VoiceMail","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"voice_mails.csv",primaryKey:"uniqueid",columnDefs:[{name:"mailbox"},{name:"fullname"},{name:"email"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/channels/voice/voicemails/view/{{row.entity.uniqueid}}/settings",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.mailbox, row.entity.uniqueid)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.list",{url:"/list",templateUrl:"app/channels/voice/voicemail/list/list.html",controller:"VoiceVoicemailListCtrl",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").controller("VoiceVoicemailViewCtrl",["$scope","VoiceMail","VoiceMailMessage","VoiceContext","$http","xAlert","$translate","$stateParams","socket","$sce","Modal","$location","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){var b={exporterCsvFilename:"voice_mail_messages.csv",primaryKey:"id",columnDefs:[{name:"callerid"},{name:"stamp",displayName:"APPLICATION_DATE",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{grid.appScope.moment(row.entity.stamp).format('YYYY-MM-DD HH:mm:ss')}}</div>"},{name:"duration",cellClass:"ui-grid-vcenter",cellTemplate:"<div>{{row.entity.duration*1000 | date:'mm:ss'}}</div>"},{name:"audio",displayName:"",width:225,enableSorting:!1,enableFiltering:!1,buttons:[{directive:'<audio-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage"></audio-file-download>'}]},{name:"action",width:150,buttons:[{directive:'<motion-file-download params="{id:row.entity.id,controller:\'download\'}" resource="grid.appScope.VoiceMailMessage" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="row.entity.msg_id+\'.wav\'"></motion-file-download>'},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.id, row.entity.id)"}]}]};a.gridOptions=m.gridOptions(c,b,a,{mailbox:a.voicemail.mailbox,context:a.voicemail.context})}a.moment=moment,a["switch"]={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.VoiceMailMessage=c,a.getVoicemail=function(){return b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b})["catch"](function(a){l.path("/voice/voicemails/list")})},a.updateVoiceVoicemail=function(){return b.update({id:h.uniqueid},a.voicemail).$promise.then(function(){f.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.error(a)})},a.getContexts=function(){return d.get().$promise.then(function(b){a.voiceContexts=b.rows})["catch"](function(a){f.error(a)})},a.getMessages=function(){return a.voicemail?void n():b.get({id:h.uniqueid}).$promise.then(function(b){delete b.password,delete b.stamp,a.voicemail=b,n()})["catch"](function(a){l.path("/voice/voicemails/view/"+h.uniqueid+"/settings")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.view",{url:"/view/:uniqueid",templateUrl:"app/channels/voice/voicemail/view/view.html",controller:"VoiceVoicemailViewCtrl",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.channels.voice.voicemails.view.settings",{url:"/settings",templateUrl:"app/channels/voice/voicemail/view/view.settings.html"}).state("main.channels.voice.voicemails.view.messages",{url:"/messages",templateUrl:"app/channels/voice/voicemail/view/view.messages.html"})}]),angular.module("xCallyShuttleApp").factory("VoiceMail",["$resource",function(a){return a("/api/voice/voicemails/:id/:controller",{uniqueid:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails",{url:"/voicemails",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:7}}})}]),angular.module("xCallyShuttleApp").factory("VoiceMailMessage",["$resource",function(a){return a("/api/voice/voicemails/messages/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("VoiceVoicemailWizardCtrl",["$scope","VoiceMail","xAlert","WizardHandler","$location","Setting",function(a,b,c,d,e,f){a.initWizard=function(){a.form={},a.item={context:"from-voicemail"}},a.next=function(){d.wizard().next()},a.previous=function(){d.wizard().previous()},a.exitValidation=function(a){return a},a.getFirstFreeMailbox=function(){f.get({controller:"mailbox"}).$promise.then(function(b){a.item.mailbox=b.value})["catch"](function(a){c.error(a)})},a.createItem=function(){return a.item.customer_id=a.item.mailbox,b.save(a.item).$promise.then(function(){e.path("/channels/voice/voicemails/list")})["catch"](function(a){c.error(data)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.channels.voice.voicemails.wizard",{url:"/wizard",templateUrl:"app/channels/voice/voicemail/wizard/wizard.html",controller:"VoiceVoicemailWizardCtrl"})}]),angular.module("xCallyShuttleApp").factory("VoiceQueue",["$resource",function(a){return a("/api/voice/queues/:id/:controller/:controller2",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Company",["$resource",function(a){return a("/api/contactmanager/companies/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies",{url:"/companies",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:5}}})}]),angular.module("xCallyShuttleApp").controller("CompanyListCreateModalCtrl",["$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("ContactManagerCompanyListCtrl",["$scope","$translate","xAlert","Modal","$uibModal","$log","Company","gridOptions","$location",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"Companies.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",name:"profile",href:"/contactmanager/companies/view/{{row.entity.id}}/settings"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"green-turquoise",name:"contacts",uisref:"main.contactmanager.contacts.list({companyId:{{row.entity.id}}})"}]}]};a.gridOptions=h.gridOptions(g,b,a)},a.create=function(){var a=e.open({animation:!0,size:"lg",templateUrl:"app/contactmanager/company/list/create.modal.html",controller:"CompanyListCreateModalCtrl"});a.result.then(function(a){return g.save(a).$promise.then(function(a){i.path("/contactmanager/companies/view/"+a.id+"/settings")})["catch"](function(a){c.error(a)})},function(){f.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.list",{url:"/list",templateUrl:"app/contactmanager/company/list/list.html",controller:"ContactManagerCompanyListCtrl",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").controller("ContactManagerCompanyViewCtrl",["$scope","xAlert","$translate","$stateParams","$location","Company",function(a,b,c,d,e,f){a.getCompany=function(){return f.get({id:d.id}).$promise.then(function(b){a.company=b})["catch"](function(a){e.path("/contactmanager/companies/list")})},a.updateCompany=function(){return f.update({id:d.id},a.company).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.companies.view",{url:"/view/:id",templateUrl:"app/contactmanager/company/view/view.html",controller:"ContactManagerCompanyViewCtrl",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.contactmanager.companies.view.settings",{url:"/settings",templateUrl:"app/contactmanager/company/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").factory("Contact",["$resource",function(a){return a("/api/contactmanager/contacts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts",{url:"/contacts",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListCopyModalCtrl",["$scope","$uibModalInstance","xAlert","List","Contact","$translate",function(a,b,c,d,e,f){a.item={},a.getLists=function(){return d.get().$promise.then(function(b){a.lists=b.rows})["catch"](function(a){c.error(a)})},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerListImportModalCtrl",["$scope","$uibModalInstance","indexes","csv","xAlert","socket","List","Contact","$translate",function(a,b,c,d,e,f,g,h,i){function j(b){if(b>=a.csvLength||a.stopped)return void(a.importing=!1);for(var c,f=[],g=b;b+200>g&&g<a.csvLength;g++)c={},_.forOwn(a.item,function(b,e){switch(e){case"tags":c.tags=[],a.item.tags.forEach(function(a){""!==d[g][a]&&c.tags.push(d[g][a])});break;default:c[e]=d[g][b]}}),c.tags=c.tags?c.tags.join(","):void 0,c.ListId=a.item.ListId,c.CompanyId=a.item.CompanyId||null,f.push(c);return h.save({controller:"bulk"},{contacts:f}).$promise.then(function(b){a["import"].success+=b.ok*a.addingQuote,a["import"].succeeded+=b.ok,a["import"].fail+=b.ko*a.addingQuote,a["import"].failed+=b.ko,j(g)})["catch"](function(b){
 a.stopped=!0,e.error(b),j(g)})}a.indexes=c,a.importing=!1,a.submitted=!1,a.stopped=!1,a["import"]={success:0,fail:0,succeeded:0,failed:0},a.csvLength=d.length,a.addingQuote=100/a.csvLength,a.forms={csv:void 0},a.item={},a.start=function(){a.importing=!0,a.submitted=!0,j(0)},a.getLists=function(){return g.get().$promise.then(function(b){a.lists=b.rows,a.item.ListId=1,a.getCustomFields()})["catch"](function(a){e.error(a)})},a.getCustomFields=function(){return g.get({listId:a.item.ListId,controller:"customfields"}).$promise.then(function(b){b.rows.forEach(function(a){a.values=JSON.parse(a.values)}),a.customFields=b.rows,f.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),f.socket.on("custom_field:save",function(b){if(b.ListId===a.item.ListId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})})["catch"](function(a){console.error(a),e.error(a)})},a.close=function(){b.close()},a.stop=function(){a.stopped=!0}}]),angular.module("xCallyShuttleApp").controller("ContactManagerContactListCtrl",["$scope","$translate","Modal","FileUploader","Papa","$uibModal","$log","Contact","gridOptions","List","uiGridConstants","xAlert","socket","$stateParams","Auth","Company",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){a.Auth=o,a.initView=function(){var c;return j.get().$promise.then(function(b){return a.lists=[],a.customFields=[],b.rows.forEach(function(b,c){_.forEach(b.CustomFields,function(b){a.customFields.push({name:b.name,alias:b.alias})}),a.lists.push({value:b.id,label:b.name})}),p.get().$promise}).then(function(b){a.companies=[],b.rows.forEach(function(b,c){a.companies.push({value:b.id,label:b.name})})}).then(function(){var d=[{"class":"blue-hoki",name:"profile",onClick:"grid.appScope.openContactTab(row.entity)"}];o.isAgent()||(d.push({"class":"green",title:b.instant("APPLICATION_COPY"),name:"copy",onClick:"grid.appScope.copy(row.entity.id)"}),d.push({"class":"red-sunglo",name:"delete",title:b.instant("APPLICATION_DELETE"),onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"})),c={exporterCsvFilename:"Contacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"email"},{name:"ListId",displayName:"APPLICATION_LIST",field:"List.name",filter:{type:k.filter.SELECT,term:n.listId||null,selectOptions:a.lists},cellTemplate:'<div class="centered-uigrid-td"><a href="/contactmanager/lists/view/{{row.entity.ListId}}/settings">{{row.entity.List.name}}</a></div>'},{name:"CompanyId",displayName:"APPLICATION_COMPANY",field:"Company.name",filter:{type:k.filter.SELECT,term:n.companyId||null,selectOptions:a.companies},cellTemplate:'<div class="centered-uigrid-td"><a href="/contactmanager/companies/view/{{row.entity.CompanyId}}/settings">{{row.entity.Company.name}}</a></div>'},{name:"tags",filterHeaderTemplate:'<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-12 col-md-offset-0 col-sm-12 col-sm-offset-0 col-xs-12 col-xs-offset-0"><div custom-grid-tags-filter-header></div></div></div>',filters:[{name:"tags"}],cellTemplate:"<div class=\"centered-uigrid-td\">{{row.entity.tags.join(',')}}</div>"}]},_.forEach(a.customFields,function(a){c.columnDefs.push({name:a.name,displayName:a.alias,visible:!1})}),c.columnDefs.push({name:"action",width:100,buttons:d}),a.gridOptions=i.gridOptions(h,c,a),m.socket.on("contact_manager:remove",function(b){a.gridOptions.getPage()})})["catch"](function(a){l.error(a)})},d.FileSelect.prototype.isEmptyAfterSelection=function(){return!0};var q=a.uploader=new d({queueLimit:1,clearInputAfterAddedToQueue:!0});q.onAfterAddingFile=function(b){console.log("fileadded"),e.parse(b._file,{header:!0,complete:function(b){a.uploader.clearQueue(),a["import"](b.data)},error:function(a){console.log(a)}})},a["import"]=function(b){var c=f.open({animation:!0,size:"lg",backdrop:"static",keyboard:!1,templateUrl:"app/contactmanager/contact/list/import.modal.html",controller:"ContactManagerListImportModalCtrl",resolve:{indexes:function(){return _.keys(b[0])},csv:function(){return b}}});c.result.then(function(b){a.gridOptions.getPage()},function(){g.info("Modal dismissed at: "+new Date)})},a.copy=function(b){var c=f.open({animation:!0,size:"small",templateUrl:"app/contactmanager/contact/list/copy.modal.html",controller:"ContactManagerListCopyModalCtrl"});c.result.then(function(c){return h.save({id:b,controller:"copy"},c).$promise.then(function(b){a.openContactTab({firstName:b.firstName,lastName:b.lastName,id:b.id})})["catch"](function(a){l.error(a)})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.contacts.list",{url:"/list",templateUrl:"app/contactmanager/contact/list/list.html",params:{listId:null,companyId:null},controller:"ContactManagerContactListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager",{url:"/contactmanager",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:5}}})}]),angular.module("xCallyShuttleApp").factory("List",["$resource",function(a){return a("/api/contactmanager/lists/:listId/:controller/:id",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.lists",{url:"/lists",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:5}}})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListListCreateModalCtrl",["$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("ContactManagerListListCtrl",["$scope","$http","$translate","Modal","xAlert","$uibModal","$log","List","gridOptions",function(a,b,c,d,e,f,g,h,i){a.initView=function(){var b={exporterCsvFilename:"Lists.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",name:"settings",href:"/contactmanager/lists/view/{{row.entity.id}}/settings"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"},{"class":"green-turquoise",name:"contacts",uisref:"main.contactmanager.contacts.list({listId:{{row.entity.id}}})"}]}]};a.gridOptions=i.gridOptions(h,b,a)},a.create=function(){var d=f.open({animation:!0,templateUrl:"app/contactmanager/list/list/create.modal.html",controller:"ContactManagerListListCreateModalCtrl"});d.result.then(function(d){b.post("/api/contactmanager/lists/",d).then(function(b){a.gridOptions.getPage(),e.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.error(a)})},function(){g.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.lists.list",{url:"/list",templateUrl:"app/contactmanager/list/list/list.html",controller:"ContactManagerListListCtrl"})}]),angular.module("xCallyShuttleApp").controller("ContactManagerListCustomFieldViewCreateModalCtrl",["$scope","$uibModalInstance","$translate",function(a,b,c){a.$translate=c,a.forms={dashboard:void 0},a.item={},a.choices=[{value:""}],a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)},a.types=[{name:"APPLICATION_TEXT",value:"text"},{name:"APPLICATION_SELECT",value:"select"}],a.ok=function(){"select"===a.item.type&&(a.item.values=angular.toJson(a.choices)),b.close(a.item)},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerListViewCtrl",["$scope","xAlert","$translate","$stateParams","socket","$location","$uibModal","$log","Modal","List","Team","gridOptions",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){var b=a.split(""),c=0,d=0;return b.shift(),b.forEach(function(a,b){"{"===a?c++:"}"===a&&(c--,c||(d=b+1))}),d?JSON.parse("["+a.substr(1,d)+"]"):[]}var n=function(){return{select:function(b){return j.save({listId:a.list.id,controller:"agents"},{agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})},deselect:function(b){return j["delete"]({listId:a.list.id,controller:"agents",agents:b}).$promise.then(function(){a.getTeams()})["catch"](function(a){console.log(a)})}}};a.getList=function(){return j.get({listId:d.id}).$promise.then(function(b){a.list=b})["catch"](function(a){f.path("/contactmanager/lists/list")})},a.updateList=function(){return j.update({id:d.id},a.list).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.error(a)})},a.getTeams=function(){return k.get({controller:"associations"}).$promise.then(function(b){return a.teams=b.rows,a.list?void 0:a.getList()}).then(function(){return a.list.defaultEntry&&f.path("/contactmanager/lists/list"),j.get({listId:d.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindQueue(a.teams,_.map(b.rows,function(a){return{id:a.id}}),n)})["catch"](function(a){console.error(a)})},a.initCustomFields=function(){var b={exporterCsvFilename:"customfields.csv",primaryKey:"id",columnDefs:[{name:"alias",displayName:"APPLICATION_NAME"},{name:"name",displayName:"APPLICATION_FIELD"},{name:"type"},{name:"description"},{name:"action",width:200,buttons:[{"class":"blue-hoki",href:"/contactmanager/lists/view/{{grid.appScope.$stateParams.id}}/customfields/settings/{{row.entity.id}}",name:"settings"},{"class":"red-sunglo",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)",name:"delete"}]}]};a.gridOptions=l.gridOptions(j,b,a,{listId:d.id,controller:"customfields"})},a.create=function(){var e=g.open({animation:!0,templateUrl:"app/contactmanager/list/view/create.modal.html",controller:"ContactManagerListCustomFieldViewCreateModalCtrl"});e.result.then(function(e){return j.save({listId:d.id,controller:"customfields"},e).$promise.then(function(){a.gridOptions.getPage(),b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})},function(){h.info("Modal dismissed at: "+new Date)})},a.getCustomField=function(){return j.get({listId:d.id,controller:"customfields",id:d.cfId}).$promise.then(function(b){if(a.customField=b,"select"===a.customField.type)try{a.choices=JSON.parse(a.customField.values)}catch(c){a.choices=m(a.customField.values)}})["catch"](function(a){console.error(a)})},a.updateCustomField=function(){var e=angular.copy(a.customField);return"select"===e.type&&(e.values=angular.toJson(a.choices)),j.update({listId:d.id,controller:"customfields",id:d.cfId},e).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.error(a)})},a.addField=function(){a.choices.push({})},a.removeField=function(b){a.choices.splice(b,1)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.contactmanager.lists.view",{url:"/view/:id",templateUrl:"app/contactmanager/list/view/view.html",controller:"ContactManagerListViewCtrl",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.contactmanager.lists.view.settings",{url:"/settings",templateUrl:"app/contactmanager/list/view/view.settings.html"}).state("main.contactmanager.lists.view.agents",{url:"/agents",templateUrl:"app/contactmanager/list/view/view.agents.html",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.contactmanager.lists.view.customfields",{url:"/customfields",templateUrl:"app/contactmanager/list/view/view.customFields.html"}).state("main.contactmanager.lists.view.customfields.settings",{url:"/settings/:cfId",templateUrl:"app/contactmanager/list/view/view.customFieldSettings.html",controller:"ContactManagerListViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("DashboardChatCtrl",["$scope","Auth","ChatRoom","socket","Agent","$q","$translate","ReportChatSession","$timeout",function(a,b,c,d,e,f,g,h,i){a.Auth=b,a.moment=moment,a["new"]=0,a.open=0,a.unmanaged=0,a.closed=0;var j=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.initAgent=function(){a.table1={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!0,columnDefs:[{name:"UserHasChatQueue.queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"}],data:[],onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){j(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)})}},a.table2={headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,columnDefs:[{name:"roomid",displayName:"APPLICATION_INTERACTION_ID",headerCellFilter:"translate"},{name:"websitename",displayName:"APPLICATION_WEBSITE",headerCellFilter:"translate"},{name:"application",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.application}} <span data-ng-if=\"row.entity.application == 'queue' && row.entity.queuename\">({{row.entity.queuename}})</span></div>"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span data-ng-if="!row.entity.leaveAt">{{\'APPLICATION_QUEUESTATUS_WAITING\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.abandon">{{\'APPLICATION_QUEUESTATUS_ABANDON\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.complete">{{\'APPLICATION_QUEUESTATUS_COMPLETE\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.timeout">{{\'APPLICATION_TIMEOUT\' | translate}}</span><span data-ng-if="!row.entity.leaveAt"> [<timer start-time="grid.appScope.moment(row.entity.updatedAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</span></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"membername",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.membername || ''}}</div>"}],data:[],gridMenuTitleFilter:function(a){var b=f.defer();return b.resolve(g.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){j(a.table2.data.length)})}},e.get({id:b.getCurrentUser().id,controller:"chat",controller1:"queues"}).$promise.then(function(b){a.table1.data=b.rows})["finally"](function(){d.socket.on("user_has_chat_queue:save",function(c){c.UserId!=b.getCurrentUser().id||_.find(a.table1.data,{id:c.ChatQueueId})||a.table1.data.push({id:c.ChatQueueId,UserHasChatQueue:c})}),d.socket.on("user_has_chat_queue:remove",function(c){c.UserId===b.getCurrentUser().id&&_.remove(a.table1.data,{id:c.ChatQueueId})})})["catch"](function(a){console.error(a)}),h.get({controller:"waiting",controller2:"applications"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){d.socket.on("report_chat_session:save",function(b){var c=_.find(a.table2.data,{id:b.id});c?(_.merge(c,b),b.leaveAt&&i(function(){_.remove(a.table2.data,{id:b.id})},1e4)):b.leaveAt||a.table2.data.push(b)}),d.socket.on("report_chat_session:remove",function(b){_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.log(a)})},a.initWidget=function(b){var e;switch(b){case"unmanaged":e=c;break;default:e=h}return e.get({id:b}).$promise.then(function(c){a[b]=c.value,a.charts={interactions:{labels:[g.instant("APPLICATION_DASHBOARD_NEW"),g.instant("APPLICATION_DASHBOARD_OPEN"),g.instant("APPLICATION_UNMANAGED"),g.instant("APPLICATION_DASHBOARD_CLOSED"),g.instant("APPLICATION_DASHBOARD_ABANDONED")],values:[a["new"],a.open,a.unmanaged,a.closed,a.abandoned],colours:["#44B6AE","#578EBE","#35AA47","#8775A7","#f3c200"]}},d.socket.on("report_chat_dashboard:"+b,function(c){a[b]=c.value,a.charts.interactions.values=[a["new"],a.open,a.unmanaged,a.closed]})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("DashboardCtrl",["$scope","$translate","Auth",function(a,b,c){}]),angular.module("xCallyShuttleApp").factory("Dashboard",["$resource",function(a){return a("/api/dashboards/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.dashboard",{"abstract":!0,url:"/dashboard",templateUrl:"app/dashboard/dashboard.html",controller:"DashboardCtrl",data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:1}}}).state("main.dashboard.voice",{url:"/voice",controller:"DashboardVoiceCtrl",templateUrl:"app/dashboard/voice/voice.html"}).state("main.dashboard.chat",{url:"/chat",controller:"DashboardChatCtrl",templateUrl:"app/dashboard/chat/chat.html",data:{permissions:{redirectTo:"landing",id:8}}}).state("main.dashboard.mail",{url:"/mail",controller:"DashboardMailCtrl",templateUrl:"app/dashboard/mail/mail.html",data:{permissions:{redirectTo:"landing",id:9}}}).state("main.dashboard.fax",{url:"/fax",controller:"DashboardFaxCtrl",templateUrl:"app/dashboard/fax/fax.html",data:{permissions:{redirectTo:"landing",id:10}}}).state("main.dashboard.sms",{url:"/sms",controller:"DashboardSmsCtrl",templateUrl:"app/dashboard/sms/sms.html",data:{permissions:{redirectTo:"landing",id:11}}}).state("main.dashboard.openchannel",{url:"/openchannel",controller:"DashboardOpenChannelCtrl",templateUrl:"app/dashboard/openchannel/openchannel.html",data:{permissions:{redirectTo:"landing",id:20}}})}]),angular.module("xCallyShuttleApp").controller("DashboardFaxCtrl",["$scope","Auth","FaxRoom","socket","Agent","$translate","$q","ReportFaxSession","$timeout",function(a,b,c,d,e,f,g,h,i){a.Auth=b,a.moment=moment,a["new"]=0,a.open=0,a.pending=0,a.closed=0,a.initAgent=function(){a.table1={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!0,columnDefs:[{name:"UserHasFaxQueue.queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"}],data:[],onRegisterApi:function(b){a.gridApi=b}},a.table2={headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,columnDefs:[{name:"roomid",displayName:"APPLICATION_INTERACTION_ID",headerCellFilter:"translate"},{name:"accountname",displayName:"APPLICATION_ACCOUNT_NAME",headerCellFilter:"translate"},{name:"application",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.application}} <span data-ng-if=\"row.entity.application == 'queue' && row.entity.queuename\">({{row.entity.queuename}})</span></div>"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span data-ng-if="!row.entity.leaveAt">{{\'APPLICATION_QUEUESTATUS_WAITING\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.complete">{{\'APPLICATION_QUEUESTATUS_COMPLETE\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.timeout">{{\'APPLICATION_TIMEOUT\' | translate}}</span><span data-ng-if="!row.entity.leaveAt"> [<timer start-time="grid.appScope.moment(row.entity.updatedAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</span></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"membername",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.membername || ''}}</span></div>"}],data:[],gridMenuTitleFilter:function(a){var b=g.defer();return b.resolve(f.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b}},e.get({id:b.getCurrentUser().id,controller:"fax",controller1:"queues"}).$promise.then(function(b){a.table1.data=b.rows})["finally"](function(){d.socket.on("user_has_fax_queue:save",function(c){c.UserId!=b.getCurrentUser().id||_.find(a.table1.data,{id:c.FaxQueueId})||a.table1.data.push({id:c.FaxQueueId,UserHasFaxQueue:c})}),d.socket.on("user_has_fax_queue:remove",function(c){c.UserId===b.getCurrentUser().id&&_.remove(a.table1.data,{id:c.FaxQueueId})})})["catch"](function(a){console.error(a)}),h.get({controller:"waiting",controller2:"applications"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){d.socket.on("report_fax_session:save",function(b){var c=_.find(a.table2.data,{id:b.id});c?(_.merge(c,b),b.leaveAt&&i(function(){_.remove(a.table2.data,{id:b.id})},1e4)):b.leaveAt||a.table2.data.push(b)}),d.socket.on("report_fax_session:remove",function(b){_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.log(a)})},a.initWidget=function(b){var e;switch(b){case"timeout":case"waiting":e=h;break;default:e=c}return e.get({id:b}).$promise.then(function(c){a[b]=c.value,a.charts={interactions:{labels:[f.instant("APPLICATION_DASHBOARD_NEW"),f.instant("APPLICATION_DASHBOARD_OPEN"),f.instant("APPLICATION_DASHBOARD_PENDING"),f.instant("APPLICATION_DASHBOARD_CLOSED")],values:[a["new"],a.open,a.pending,a.closed],colours:["#44B6AE","#578EBE","#35AA47","#8775A7"]}},d.socket.on("report_fax_dashboard:"+b,function(c){a[b]=c.value,a.charts.interactions.values=[a["new"],a.open,a.pending,a.closed]})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("DashboardMailCtrl",["$scope","Auth","MailRoom","socket","Agent","$translate","$q","ReportMailSession","$timeout",function(a,b,c,d,e,f,g,h,i){a.Auth=b,a.moment=moment,a["new"]=0,a.open=0,a.pending=0,a.closed=0,a.charts={interactions:{labels:[f.instant("APPLICATION_DASHBOARD_NEW"),f.instant("APPLICATION_DASHBOARD_OPEN"),f.instant("APPLICATION_DASHBOARD_PENDING"),f.instant("APPLICATION_DASHBOARD_CLOSED")],values:[a["new"],a.open,a.pending,a.closed],colours:["#44B6AE","#578EBE","#35AA47","#8775A7"]}},a.initAgent=function(){a.table1={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!0,columnDefs:[{name:"UserHasMailQueue.queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"}],data:[],onRegisterApi:function(b){a.gridApi=b}},a.table2={headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,columnDefs:[{name:"roomid",displayName:"APPLICATION_INTERACTION_ID",headerCellFilter:"translate"},{name:"accountname",displayName:"APPLICATION_ACCOUNT_NAME",headerCellFilter:"translate"},{name:"application",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.application}} <span data-ng-if=\"row.entity.application == 'queue' && row.entity.queuename\">({{row.entity.queuename}})</span></div>"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span data-ng-if="!row.entity.leaveAt">{{\'APPLICATION_QUEUESTATUS_WAITING\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.complete">{{\'APPLICATION_QUEUESTATUS_COMPLETE\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.timeout">{{\'APPLICATION_TIMEOUT\' | translate}}</span><span data-ng-if="!row.entity.leaveAt"> [<timer start-time="grid.appScope.moment(row.entity.updatedAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</span></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"membername",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.membername || ''}}</span></div>"}],data:[],gridMenuTitleFilter:function(a){var b=g.defer();return b.resolve(f.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){})}},e.get({id:b.getCurrentUser().id,controller:"mail",controller1:"queues"}).$promise.then(function(b){a.table1.data=b.rows})["finally"](function(){d.socket.on("user_has_mail_queue:save",function(c){c.UserId!=b.getCurrentUser().id||_.find(a.table1.data,{id:c.MailQueueId})||a.table1.data.push({id:c.MailQueueId,UserHasMailQueue:c})}),d.socket.on("user_has_mail_queue:remove",function(c){c.UserId===b.getCurrentUser().id&&_.remove(a.table1.data,{id:c.MailQueueId})})})["catch"](function(a){console.error(a)}),h.get({controller:"waiting",controller2:"applications"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){d.socket.on("report_mail_session:save",function(b){var c=_.find(a.table2.data,{id:b.id});c?(_.merge(c,b),b.leaveAt&&i(function(){_.remove(a.table2.data,{id:b.id})},1e4)):b.leaveAt||a.table2.data.push(b)}),d.socket.on("report_mail_session:remove",function(b){_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.log(a)})},a.initWidget=function(b){var e;switch(b){case"timeout":case"waiting":e=h;break;default:e=c}return e.get({id:b}).$promise.then(function(c){a[b]=c.value,a.charts={interactions:{labels:[f.instant("APPLICATION_DASHBOARD_NEW"),f.instant("APPLICATION_DASHBOARD_OPEN"),f.instant("APPLICATION_DASHBOARD_PENDING"),f.instant("APPLICATION_DASHBOARD_CLOSED")],values:[a["new"],a.open,a.pending,a.closed],colours:["#44B6AE","#578EBE","#35AA47","#8775A7"]}},d.socket.on("report_mail_dashboard:"+b,function(c){a[b]=c.value,a.charts.interactions.values=[a["new"],a.open,a.pending,a.closed]})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("DashboardOpenChannelCtrl",["$scope","Auth","OpenChannelRoom","socket","Agent","$translate","$q","ReportOpenChannelSession","$timeout",function(a,b,c,d,e,f,g,h,i){a.Auth=b,a.moment=moment,a["new"]=0,a.open=0,a.pending=0,a.closed=0,a.initAgent=function(){a.table1={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!0,columnDefs:[{name:"UserHasOpenchannelQueue.queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"}],data:[],onRegisterApi:function(b){a.gridApi=b}},a.table2={headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,columnDefs:[{name:"roomid",displayName:"APPLICATION_INTERACTION_ID",headerCellFilter:"translate"},{name:"accountname",displayName:"APPLICATION_ACCOUNT_NAME",headerCellFilter:"translate"},{name:"application",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.application}} <span data-ng-if=\"row.entity.application == 'queue' && row.entity.queuename\">({{row.entity.queuename}})</span></div>"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span data-ng-if="!row.entity.leaveAt">{{\'APPLICATION_QUEUESTATUS_WAITING\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.complete">{{\'APPLICATION_QUEUESTATUS_COMPLETE\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.timeout">{{\'APPLICATION_TIMEOUT\' | translate}}</span><span data-ng-if="!row.entity.leaveAt"> [<timer start-time="grid.appScope.moment(row.entity.updatedAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</span></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"membername",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.membername || ''}}</span></div>"}],data:[],gridMenuTitleFilter:function(a){var b=g.defer();return b.resolve(f.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b}},e.get({id:b.getCurrentUser().id,controller:"openchannel",controller1:"queues"}).$promise.then(function(b){a.table1.data=b.rows})["finally"](function(){d.socket.on("user_has_openchannel_queue:save",function(c){c.UserId!=b.getCurrentUser().id||_.find(a.table1.data,{id:c.OpenChannelQueueId})||a.table1.data.push({id:c.OpenChannelQueueId,UserHasOpenChannelQueue:c})}),d.socket.on("user_has_openchannel_queue:remove",function(c){c.UserId===b.getCurrentUser().id&&_.remove(a.table1.data,{id:c.OpenChannelQueueId})})})["catch"](function(a){console.error(a)}),h.get({controller:"waiting",controller2:"applications"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){d.socket.on("report_openchannel_session:save",function(b){var c=_.find(a.table2.data,{id:b.id});c?(_.merge(c,b),b.leaveAt&&i(function(){_.remove(a.table2.data,{id:b.id})},1e4)):b.leaveAt||a.table2.data.push(b)}),d.socket.on("report_openchannel_session:remove",function(b){_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.log(a)})},a.initWidget=function(b){var e;switch(b){case"timeout":case"waiting":e=h;break;default:e=c}return e.get({id:b}).$promise.then(function(c){a[b]=c.value,a.charts={interactions:{labels:[f.instant("APPLICATION_DASHBOARD_NEW"),f.instant("APPLICATION_DASHBOARD_OPEN"),f.instant("APPLICATION_DASHBOARD_PENDING"),f.instant("APPLICATION_DASHBOARD_CLOSED")],values:[a["new"],a.open,a.pending,a.closed],colours:["#44B6AE","#578EBE","#35AA47","#8775A7"]}},d.socket.on("report_openchannel_dashboard:"+b,function(c){a[b]=c.value,a.charts.interactions.values=[a["new"],a.open,a.pending,a.closed]})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("DashboardSmsCtrl",["$scope","Auth","SmsRoom","socket","Agent","$translate","$q","ReportSmsSession","$timeout",function(a,b,c,d,e,f,g,h,i){a.Auth=b,a.moment=moment,a["new"]=0,a.open=0,a.pending=0,a.closed=0,a.initAgent=function(){a.table1={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!0,columnDefs:[{name:"UserHasSmsQueue.queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"}],data:[],onRegisterApi:function(b){a.gridApi=b}},a.table2={headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,columnDefs:[{name:"roomid",displayName:"APPLICATION_INTERACTION_ID",headerCellFilter:"translate"},{name:"accountname",displayName:"APPLICATION_ACCOUNT_NAME",headerCellFilter:"translate"},{name:"application",displayName:"APPLICATION_APPLICATION",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.application}} <span data-ng-if=\"row.entity.application == 'queue' && row.entity.queuename\">({{row.entity.queuename}})</span></div>"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span data-ng-if="!row.entity.leaveAt">{{\'APPLICATION_QUEUESTATUS_WAITING\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.complete">{{\'APPLICATION_QUEUESTATUS_COMPLETE\' | translate}}</span><span data-ng-if="row.entity.leaveAt && row.entity.timeout">{{\'APPLICATION_TIMEOUT\' | translate}}</span><span data-ng-if="!row.entity.leaveAt"> [<timer start-time="grid.appScope.moment(row.entity.updatedAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</span></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"membername",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.membername || ''}}</span></div>"
 }],data:[],gridMenuTitleFilter:function(a){var b=g.defer();return b.resolve(f.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b}},e.get({id:b.getCurrentUser().id,controller:"sms",controller1:"queues"}).$promise.then(function(b){a.table1.data=b.rows})["finally"](function(){d.socket.on("user_has_sms_queue:save",function(c){c.UserId!=b.getCurrentUser().id||_.find(a.table1.data,{id:c.SmsQueueId})||a.table1.data.push({id:c.SmsQueueId,UserHasSmsQueue:c})}),d.socket.on("user_has_sms_queue:remove",function(c){c.UserId===b.getCurrentUser().id&&_.remove(a.table1.data,{id:c.SmsQueueId})})})["catch"](function(a){console.error(a)}),h.get({controller:"waiting",controller2:"applications"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){d.socket.on("report_sms_session:save",function(b){var c=_.find(a.table2.data,{id:b.id});c?(_.merge(c,b),b.leaveAt&&i(function(){_.remove(a.table2.data,{id:b.id})},1e4)):b.leaveAt||a.table2.data.push(b)}),d.socket.on("report_sms_session:remove",function(b){_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.log(a)})},a.initWidget=function(b){var e;switch(b){case"timeout":case"waiting":e=h;break;default:e=c}return e.get({id:b}).$promise.then(function(c){a[b]=c.value,a.charts={interactions:{labels:[f.instant("APPLICATION_DASHBOARD_NEW"),f.instant("APPLICATION_DASHBOARD_OPEN"),f.instant("APPLICATION_DASHBOARD_PENDING"),f.instant("APPLICATION_DASHBOARD_CLOSED")],values:[a["new"],a.open,a.pending,a.closed],colours:["#44B6AE","#578EBE","#35AA47","#8775A7"]}},d.socket.on("report_sms_dashboard:"+b,function(c){a[b]=c.value,a.charts.interactions.values=[a["new"],a.open,a.pending,a.closed]})})["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").controller("DashboardVoiceCtrl",["$scope","$rootScope","$timeout","Auth","ReportQueue","ReportCall","Agent","VoiceQueue","Dashboard","socket",function(a,b,c,d,e,f,g,h,i,j){a.radioSwitch={size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"success",onColor:"danger"};var k=function(a,b){var c=a?30*a+100:177;angular.element(document.getElementsByName(b)[0]).css("height",c+"px")};a.initUser=function(){var b;if(a.user=d.getCurrentUser(),a.voice={},a.$on("$destroy",function(){b&&(b.terminate(),j.socket.removeAllListeners("dashboard:voice:waiting"),j.socket.removeAllListeners("dashboard:voice:active"),j.socket.removeAllListeners("dashboard:voice:complete"),j.socket.removeAllListeners("dashboard:voice:abandon"),j.socket.removeAllListeners("dashboard:voice:unmanaged"),j.socket.removeAllListeners("dashboard:voice:holdtime"),j.socket.removeAllListeners("dashboard:voice:talktime"))}),a.onmessage=function(b){a.voice=b.data,a.$apply()},window.Worker){switch(b=new Worker("assets/workers/dashboard/voice/worker.js"),a.user.role){case"admin":h.get().$promise.then(function(a){return b.postMessage({evt:"myQueues",queues:a.rows}),i.get({id:"voice",controller:"init"}).$promise}).then(function(a){a.evt="dashboard:voice:init",b.postMessage(a)})["catch"](function(a){console.error(a)});break;case"user":b.postMessage({evt:"myQueues",queues:a.user.PVoiceQueues}),i.get({id:"voice",controller:"init"}).$promise.then(function(a){a.evt="dashboard:voice:init",b.postMessage(a)})}b.onmessage=a.onmessage}j.socket.on("dashboard:voice:waiting",function(a){a.evt="dashboard:voice:waiting",b.postMessage(a)}),j.socket.on("dashboard:voice:active",function(a){a.evt="dashboard:voice:active",b.postMessage(a)}),j.socket.on("dashboard:voice:complete",function(a){a.evt="dashboard:voice:complete",b.postMessage(a)}),j.socket.on("dashboard:voice:abandon",function(a){a.evt="dashboard:voice:abandon",b.postMessage(a)}),j.socket.on("dashboard:voice:unmanaged",function(a){a.evt="dashboard:voice:unmanaged",b.postMessage(a)}),j.socket.on("dashboard:voice:talktime",function(a){a.evt="dashboard:voice:talktime",b.postMessage(a)}),j.socket.on("dashboard:voice:holdtime",function(a){a.evt="dashboard:voice:holdtime",b.postMessage(a)}),j.socket.on("dashboard:voice:outbound",function(a){a.evt="dashboard:voice:outbound",b.postMessage(a)})},a.initAgent=function(){return a.agent=d.getCurrentUser(),j.socket.on("voice:queue:agent:join",function(b){b.loggedAt=moment().format("YYYY-MM-DD HH:mm:ss"),b.callstaken=0,a.table1.data.push(b)}),j.socket.on("voice:queue:agent:leave",function(b){_.remove(a.table1.data,{queue:b.queue})}),a.table1={enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,enableSorting:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,columnDefs:[{name:"queue",headerCellFilter:"translate",displayName:"APPLICATION_QUEUE",cellClass:"text-center ui-grid-vcenter"},{name:"loggedAt",displayName:"logged At",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.loggedAt"></span></div>'},{name:"lastcall",headerCellFilter:"translate",displayName:"APPLICATION_LAST_CALL",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.lastcall"></span></div>'},{name:"callstaken",headerCellFilter:"translate",displayName:"APPLICATION_CALLS_TAKEN",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{row.entity.callstaken || 0}}</span></div>"}],data:[],onRegisterApi:function(b){a.gridApi=b,a.gridApi.pagination.on.paginationChanged(a,function(b,c){k(c>a.table1.data.length?a.table1.data.length:c,"table1")})}},a.table2={enableGridMenu:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:0,multiSelect:!1,columnDefs:[{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate"},{name:"status",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div><span>{{'APPLICATION_QUEUESTATUS_WAITING' | translate}}</span>[<timer start-time=\"grid.appScope.moment(row.entity.updatedAt).unix()*1000\">{{hhours}}:{{mminutes}}:{{sseconds}}</timer>]</div>",enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"caller",displayName:"APPLICATION_CALLER",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.calleridnum || ''}} {{row.entity.calleridname || ''}}</span></div>",enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1},{name:"position",displayName:"APPLICATION_POSITION",headerCellFilter:"translate"},{name:"agent",displayName:"APPLICATION_AGENT",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.connectedlinenum || ''}} {{row.entity.connectedlinename || ''}}</span></div>",enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1}],data:[],onRegisterApi:function(b){a.gridApi1=b,a.gridApi1.grid.registerDataChangeCallback(function(){k(a.gridApi1.core.getVisibleRows(a.gridApi1.grid).length,"table2")})}},a.table3={exporterCsvFilename:"abandoned_calls.csv",enableRowHeaderSelection:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!1,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,enableSelectAll:!1,enableHorizontalScrollbar:0,enableVerticalScrollbar:1,columnDefs:[{name:"queue",displayName:"APPLICATION_QUEUE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter"},{name:"caller",displayName:"APPLICATION_CALLER",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.calleridnum || ''}} {{row.entity.calleridname || ''}}</div>"},{name:"createdAt",displayName:"APPLICATION_DATE",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:"<div>{{row.entity.updatedAt | date:'yyyy-MM-dd HH:mm:ss'}}</div>"},{name:"lastAssignedTo",cellClass:"text-center ui-grid-vcenter",displayName:"APPLICATION_LAST_ASSIGNED_TO",headerCellFilter:"translate"},{name:"assigned",displayName:"APPLICATION_STATUS",headerCellFilter:"translate",cellTemplate:'<div class="centered-uigrid-td"><input data-ng-change="grid.appScope.updateItem(row.entity)", bs-switch ng-model="row.entity.assigned" type="checkbox" switch-active="{{ !row.entity.assigned || grid.appScope.agent.name === row.entity.lastAssignedTo }}" switch-on-text="{{ \'APPLICATION_ASSIGNED\' | translate }}" switch-off-text="{{ \'APPLICATION_FREE\' | translate }}" switch-on-color="{{ grid.appScope.radioSwitch.onColor }}" switch-off-color="{{ grid.appScope.radioSwitch.offColor }}" switch-animate="{{ grid.appScope.radioSwitch.animate }}" switch-size="{{ grid.appScope.radioSwitch.size }}" switch-label="{{ grid.appScope.radioSwitch.label }}" switch-icon="{{ grid.appScope.radioSwitch.icon }}" switch-radio-off="{{ grid.appScope.radioSwitch.radioOff }}" switch-label-width="{{ grid.appScope.radioSwitch.labelWidth }}" switch-handle-width="{{ grid.appScope.radioSwitch.handleWidth }}"></div>',enableFiltering:!1}],data:[],onRegisterApi:function(b){a.gridApi2=b,a.gridApi2.grid.registerDataChangeCallback(function(){k(a.gridApi2.core.getVisibleRows(a.gridApi2.grid).length,"table3")})}},g.get({id:d.getCurrentUser().id,controller:"voice",controller1:"queues"}).$promise.then(function(b){a.table1.data=_.map(b.rows,function(a){return{queue:a.UserHasVoiceQueue.queue,loggedAt:a.UserHasVoiceQueue.loggedAt,callstaken:a.UserHasVoiceQueue.callstaken,lastcall:a.UserHasVoiceQueue.lastcall}})})["finally"](function(){k(a.table1.paginationPageSize>a.table1.data.length?a.table1.data.length:a.table1.paginationPageSize,"table1"),j.socket.on("voice:queue:update",function(b){var c=_.find(a.table1.data,{queue:b.queue});c?_.merge(c,b):a.table1.data.push(b)}),j.socket.on("user_has_voice_queue:remove",function(b){b.UserId===d.getCurrentUser().id&&_.remove(a.table1.data,{name:b.queue})})})["catch"](function(a){console.error(a)}),e.get({id:"waiting",controller:"calls"}).$promise.then(function(b){a.table2.data=b.rows})["finally"](function(){j.socket.on("report_queue:save",function(b){a.table2.data.push(b)}),j.socket.on("report_queue:update",function(b){var c=_.find(a.table2.data,{id:b.id});c&&b.queuecallerleaveAt&&_.remove(a.table2.data,{id:b.id})})})["catch"](function(a){console.error(a)}),e.get({controller:"abandoned",controller2:"all"}).$promise.then(function(b){a.table3.data=b.rows})["catch"](function(a){console.error(a)})["finally"](function(){j.socket.on("report_queue:save",function(b){a.table3.data.unshift(b)}),j.socket.on("report_queue:update",function(b){var c=_.find(a.table3.data,{id:b.id});c&&_.merge(c,b)})})},a.updateItem=function(b){return e.update({id:b.id},{assigned:b.assigned,lastAssignedTo:b.assigned?a.agent.name:void 0}).$promise["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk",{url:"/desk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("DeskAccount",["$resource",function(a){return a("/api/desk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("DeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedDeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedDeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("desk_account"),b.url="/api/desk/accounts",h.getPage(b).then(function(d){a.displayedDeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedDeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedDeskAccounts.length)}),f.socket.on("desk_account:save",function(){a.initList(b)}),f.socket.on("desk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/desk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.error(a)})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/desk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.error(a)})}),a.checkAccount=function(a){b.get("/api/desk/accounts/"+a+"/check").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.desk.list",{url:"/list",templateUrl:"app/desk/list/list.html",controller:"DeskListCtrl",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").controller("DeskViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","desk_com",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(){f.wizard().next()},a.formValidation=function(a){return a},a.$on("$destroy",function(){g.unsyncUpdates("desk_configuration"),g.unsyncUpdates("desk_field")}),a.initView=function(){b.get("/api/desk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){h.error(a)})},a.updateItem=function(){b.put("/api/desk/accounts/"+c.id,a.account).success(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})},a.getConfigurations=function(){b.get("/api/desk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,g.socket.on("desk_configuration:remove",function(b){_.remove(a.configurations,{id:b.id})})}).error(function(a){h.error(a)})},a.deleteConfiguration=i.confirm["delete"](function(a){b["delete"]("api/desk/configurations/"+a).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})}),a.createConfiguration=function(){a.configuration.AccountId=c.id,b.post("api/desk/configurations",a.configuration).success(function(a){e.path("desk/view/"+c.id+"/configurations/settings/"+a.id)}).error(function(){h.show("Something went wrong!","danger")})},a.fieldType=["string","variable"],a.descFieldType=["string","key_value"],a.getFields=function(){b.get("/api/desk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=j.fields.concat(b)}).error(function(a){h.error(a)})},a.getConfiguration=function(){b.get("/api/desk/configurations/"+c.configurationId).success(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,g.socket.on("desk_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){h.error(a)})},a.getVariables=function(){b.get("/api/variables").success(function(b){a.variables=b.rows}).error(function(a){h.error(a)})},a.removeItem=function(a){b["delete"]("api/desk/fields/"+a.id).success(function(){h.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(){h.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")})},a.addItemSubject=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/subject",d).success(function(b){a.subjectConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemDescription=function(){var d={type:"string",content:""};b.post("/api/desk/configurations/"+c.configurationId+"/description",d).success(function(b){a.descriptionConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.addItemField=function(){var d={content:""};b.post("/api/desk/configurations/"+c.configurationId+"/field",d).success(function(b){a.fieldConfig.push(b)}).error(function(){h.show("Something went wrong!","danger")})},a.updateField=function(a){b.put("/api/desk/fields/"+a.id,a).success(function(){}).error(function(){h.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){if(b.content="",b.idField){var c=_.find(a.accountFields,"id",b.idField);c&&(b.customField=_.result(c,"custom",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"id",b);return c?c.data.choices?c.data.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.view",{url:"/view/:id",templateUrl:"app/desk/view/view.html",controller:"DeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.desk.view.account",{url:"/account",templateUrl:"app/desk/view/view.account.html"}).state("main.desk.view.configurations",{url:"/configurations",templateUrl:"app/desk/view/view.configurations.html"}).state("main.desk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/desk/view/view.configurationSettings.html",controller:"DeskViewCtrl"}).state("main.desk.view.configuration",{url:"/configuration",templateUrl:"app/desk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("DeskWizardCtrl",["$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(){console.log(a.item),b.post("api/desk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/desk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.desk.wizard",{url:"/wizard",templateUrl:"app/desk/wizard/wizard.html",controller:"DeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk",{url:"/freshdesk",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").factory("FreshdeskAccount",["$resource",function(a){return a("/api/freshdesk/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("FreshdeskListCtrl",["$scope","$http","$rootScope","xAlert","$translate","socket","Modal","stResource",function(a,b,c,d,e,f,g,h){a.conf={accountsByPage:{name:"10",value:10}},a.accountsByPage=[{name:"10",value:10},{name:"25",value:25},{name:"50",value:50},{name:"All",value:0}],a.accounts={checked:[]},a.check=function(b,c){c?a.accounts.checked=angular.copy(_.map(a.displayedFreshdeskAccounts,"id")):a.accounts.checked=[]},a.getAccounts=function(b){return _.map(a.displayedFreshdeskAccounts,function(a){var c={};return b.forEach(function(b){c[b]=a[b]}),c})},a.initList=function(b){f.unsyncUpdates("freshdesk_account"),b.url="/api/freshdesk/accounts",h.getPage(b).then(function(d){a.displayedFreshdeskAccounts=d.rows,b.pagination.numberOfPages=d.total_pages,c.updateTableConfig(a.accountsByPage,a.displayedFreshdeskAccounts.length),c.updateTableConfig(a.conf.accountsByPage,a.displayedFreshdeskAccounts.length)}),f.socket.on("freshdesk_account:save",function(){a.initList(b)}),f.socket.on("freshdesk_account:remove",function(c){a.accounts.checked=_.without(a.accounts.checked,c.id),a.initList(b)})},a.deleteItem=g.confirm["delete"](function(a){b["delete"]("/api/freshdesk/accounts/"+a).success(function(){d.show(e.instant("MESSAGE_WELL_DONE")+"!","success")}).error(function(a){d.error(a)})}),a.deleteItems=g.confirm["delete"](function(){b["delete"]("/api/freshdesk/accounts",{params:{id:a.accounts.checked}}).success(function(){d.show(e.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){d.error(a)})}),a.checkAccount=function(a){b.get("/api/freshdesk/accounts/"+a+"/check").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.freshdesk.list",{url:"/list",templateUrl:"app/freshdesk/list/list.html",controller:"FreshdeskListCtrl",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").controller("FreshdeskViewCtrl",["$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("freshdesk_configuration"),h.unsyncUpdates("freshdesk_field")}),a.initView=function(){b.get("/api/freshdesk/accounts/"+c.id).success(function(b){a.account=b}).error(function(a){i.error(a)})},a.updateItem=function(){b.put("/api/freshdesk/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/freshdesk/configurations",{params:{AccountId:c.id}}).success(function(b){a.configurations=b,h.socket.on("freshdesk_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/freshdesk/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/freshdesk/configurations",a.configuration).success(function(a){e.path("freshdesk/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/freshdesk/accounts/"+c.id+"/fields").success(function(b){a.accountFields=[],b=f("freshdesk")(b),_.forEach(b,function(b){a.accountFields.push(b.ticket_field)})}).error(function(a){i.error(a)})},a.getConfiguration=function(){b.get("/api/freshdesk/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("freshdesk_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/freshdesk/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/freshdesk/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/freshdesk/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/freshdesk/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/freshdesk/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){if(b.content="",b.idField){var c=_.find(a.accountFields,"name",b.idField);c&&(b.customField=!_.result(c,"default",!0))}a.updateField(b)},a.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);return c?c.choices.length>0?c.choices:null:void 0}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.view",{url:"/view/:id",templateUrl:"app/freshdesk/view/view.html",controller:"FreshdeskViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.freshdesk.view.account",{url:"/account",templateUrl:"app/freshdesk/view/view.account.html"}).state("main.freshdesk.view.configurations",{url:"/configurations",templateUrl:"app/freshdesk/view/view.configurations.html"}).state("main.freshdesk.view.configurations.settings",{url:"/settings/:configurationId",templateUrl:"app/freshdesk/view/view.configurationSettings.html",controller:"FreshdeskViewCtrl"}).state("main.freshdesk.view.configuration",{url:"/configuration",templateUrl:"app/freshdesk/view/view.configuration.html"})}]),angular.module("xCallyShuttleApp").controller("FreshdeskWizardCtrl",["$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(){console.log(a.item),b.post("api/freshdesk/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/freshdesk/list")}).error(function(){e.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.freshdesk.wizard",{url:"/wizard",templateUrl:"app/freshdesk/wizard/wizard.html",controller:"FreshdeskWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.iframe",{url:"/iframe",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("IframeViewCtrl",["$scope","Auth","Integration","xAlert","$translate","$sce",function(a,b,c,d,e,f){a.Auth=b,a.initView=function(){return c.get({state:"iframe"}).$promise.then(function(c){a.iframe=_.first(c.rows),a.iframe.remoteUri?a.url=f.trustAsResourceUrl(a.iframe.remoteUri):b.isAgent()&&d.show(e.instant("MESSAGE_NO_IFRAME_CONFIGURED")+".","danger")})["catch"](function(a){d.error(a)})},a.updateItem=function(){return b.isAgent()?void 0:c.update({id:a.iframe.id},a.iframe).$promise.then(function(){d.show(e.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){d.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.iframe.view",{url:"/view",templateUrl:"app/iframe/view/view.html",controller:"IframeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Integration",["$resource",function(a){return a("/api/integrations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations",{url:"/integrations",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:19}}})}]),angular.module("xCallyShuttleApp").controller("IntegrationListCtrl",["$scope","Modal","socket","FileUploader","Integration","xAlert",function(a,b,c,d,e,f){a.integrationsByPage=10;var g=a.uploader=new d({url:"api/integrations",autoUpload:!0,removeAfterUpload:!0});g.filters.push({name:"zipFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|zip|".indexOf(b)}}),g.onSuccessItem=function(a,b,c,d){console.info("onSuccessItem",a,b,c,d),f.show(b.name,"success")},g.onErrorItem=function(a,b,c,d){console.info("onErrorItem",a,b,c,d),b.errors.forEach(function(a){f.error(err)})},a.deleteItem=b.confirm["delete"](function(a){e["delete"]({id:a},function(){f.show("Integration Removed","success")},function(a){f.error(a)})}),a.initList=function(){a.integrations=e.query({},function(a){c.syncUpdates("integration",a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.integrations.list",{url:"/list",templateUrl:"app/integration/list/list.html",controller:"IntegrationListCtrl",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").config(["$stateProvider",function(a){a.state("main.jscripty",{url:"/jscripty",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("JscriptyProject",["$resource",function(a){return a("/api/jscripty/projects/:id/:controller/:action/:action2",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCtrl",["$scope","$uibModal","JscriptyProject","gridOptions","Auth",function(a,b,c,d,e){a.isAdmin=e.isAdmin(),a.initView=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:300,buttons:[{"class":"blue-hoki",icon:"icon-settings",href:"/jscripty/projects/view/{{row.entity.id}}",hide:!e.isAdmin()},{"class":" green-turquoise",icon:"fa fa-play",onClick:"grid.appScope.openJscriptyTab(row.entity)"},{"class":"purple",icon:"icon-book-open",href:"/jscripty/projects/report/{{row.entity.id}}/sessions",hide:!e.isAdmin()},{"class":"red-sunglo",icon:"fa fa-trash",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)",hide:!e.isAdmin()}]}]};a.gridOptions=d.gridOptions(c,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/jscripty/project/list/list.create.modal.html",controller:"JscriptyProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","JscriptyProject","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){console.log(a),e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){
-a.state("main.jscripty.projects.list",{url:"/list",templateUrl:"app/jscripty/project/list/list.html",controller:"JscriptyProjectListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectReportCtrl",["$scope","uiGridConstants","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope","gridOptions","JscriptyProject","$location",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a.projectStats={started:0,incomplete:0,completed:0},a.projectId=e.id,a.initView=function(){m.get({id:e.id}).$promise.then(function(b){a.project=b})["catch"](function(a){i.error(a)}),m.get({id:e.id,controller:"sessions"}).$promise.then(function(b){var c=_.groupBy(b.rows,"status");a.projectStats.started=c.started?c.started.length:0,a.projectStats.completed=c.completed?c.completed.length:0,a.projectStats.incomplete=c.incomplete?c.incomplete.length:0})["catch"](function(a){i.error(a)})},a.pdf=function(a,b){var c=[];if(a){var d=html2canvas(document.getElementById(a)),e=d.parse(),f=d.render(e),g=f.toDataURL("image/png");c.push({image:g,width:500,style:"img"})}b.length&&_.forEach(b,function(a){var b=html2canvas(document.getElementById(a.question_id)),d=b.parse(),e=b.render(d),f=e.toDataURL("image/png");c.push({image:f,width:500,style:"img"})});var h={content:c};pdfMake.createPdf(h).download("Project_summary.pdf")},a.getProjectSessions=function(){var c={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"queue",displayName:"APPLICATION_QUEUE"},{name:"membername",displayName:"APPLICATION_AGENT"},{name:"calleridnum",displayName:"APPLICATION_CALLERIDNUM"},{name:"createdAt",displayName:"APPLICATION_STARTEDAT",filterHeaderTemplate:'<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',filters:[{name:"From",condition:b.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:b.filter.LESS_THAN_OR_EQUAL}]},{name:"completedAt",displayName:"APPLICATION_COMPLETEDAT",filterHeaderTemplate:'<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',filters:[{name:"From",condition:b.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:b.filter.LESS_THAN_OR_EQUAL}]},{name:"status",displayName:"APPLICATION_STATUS"},{name:"last_question_id",displayName:"APPLICATION_LASTQUESTIONID"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/{{row.entity.projectId}}/session/{{row.entity.session_id}}",name:"Detail"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteSession(row.entity.session_id)"}]}]};a.gridOptions=l.gridOptions(m,c,a,{id:e.id,controller:"sessions"})},a.deleteSession=function(b){m["delete"]({id:e.id,controller:"sessions",action:b}).$promise.then(function(b){a.gridOptions.getPage(),a.initView(),i.show(j.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){i.error(a)})},a.getSessionDetails=function(){m.get({id:e.id,controller:"sessions",action:e.sessionId}).$promise.then(function(b){a.session=b,a.sessionQuestions=b.ReportJscriptyQuestions})["catch"](function(a){i.error(a)})},a.getQuestionSummary=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"question_id",displayName:"APPLICATION_QUESTIONID"},{name:"question_type",displayName:"APPLICATION_QUESTIONTYPE"},{name:"question_label",displayName:"APPLICATION_QUESTIONLABEL"},{name:"question_text",displayName:"APPLICATION_QUESTION"},{name:"count",displayName:"APPLICATION_COUNT",enableFiltering:!1},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/"+e.id+"/detail/{{row.entity.question_id}}",name:"Detail"}]}]};a.gridOptions=l.gridOptions(m,b,a,{id:e.id,controller:"questions",action:"summary"})},a.getQuestionInputs=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"question_id",displayName:"APPLICATION_QUESTIONID",enableFiltering:!1},{name:"question_label",displayName:"APPLICATION_QUESTIONLABEL",enableFiltering:!1},{name:"question_text",displayName:"APPLICATION_QUESTION",enableFiltering:!1},{name:"input_label",displayName:"APPLICATION_INPUTLABEL",enableFiltering:!1},{name:"input_value",cellTemplate:'<div uib-tooltip="{{row.entity.input_value}}">{{row.entity.input_value}}</div>',displayName:"APPLICATION_INPUTVALUE",enableFiltering:!1}]};a.gridOptions=l.gridOptions(m,b,a,{id:e.id,controller:"inputs"})},a.getProjectDetail=function(){a.projectDetail=[],m.query({id:e.id,controller:"questions",action:"detail"}).$promise.then(function(b){console.log(e.questionId),e.questionId?a.projectDetail.push(_.find(b,function(a){return a.question_id==parseInt(e.questionId)})):a.projectDetail=b,console.log(a.projectDetail)})["catch"](function(a){i.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.report",{url:"/report/:id",templateUrl:"app/jscripty/project/report/report.html",controller:"JscriptyProjectReportCtrl"}).state("main.jscripty.projects.report.sessions",{url:"/sessions",templateUrl:"app/jscripty/project/report/report.sessions.html"}).state("main.jscripty.projects.report.summary",{url:"/summary",templateUrl:"app/jscripty/project/report/report.summary.html"}).state("main.jscripty.projects.report.inputs",{url:"/inputs",templateUrl:"app/jscripty/project/report/report.inputs.html"}).state("main.jscripty.projects.report.detail",{url:"/detail",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.questionDetail",{url:"/detail/:questionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.sessionDetail",{url:"/session/:sessionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.session.detail.html"})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectViewCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope",function(a,b,c,d,e,f,g,h,i,j){a.jscriptyProject={},a.getProject=function(){b.get("/api/jscripty/projects/"+d.id).success(function(b){a.jscriptyProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!=a&&-1!=a.indexOf("Script error."));else{var d=new Image;d.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(e){}},b.token=f.getToken();var a=new EditorUi(new Editor);a.openString(b.draft,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),e.syncUpdates("jscripty_project",[b],function(a,c,d){c.id===b.id})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.view",{url:"/view/:id",templateUrl:"app/jscripty/project/view/view.html",controller:"JscriptyProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/jscripty/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/jscripty/js/Editor.js","assets/plugins/jscripty/js/Graph.js","assets/plugins/jscripty/js/EditorUi.js","assets/plugins/jscripty/js/Actions.js","assets/plugins/jscripty/js/Menus.js","assets/plugins/jscripty/js/Sidebar.js","assets/plugins/jscripty/js/Toolbar.js","assets/plugins/jscripty/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LandingCtrl",["$scope","$location","$window","$timeout","Auth","Setting",function(a,b,c,d,e,f){a.initLanding=function(){a.year=moment().year(),f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)});var c,g,h;return(h=e.getCurrentUser().$promise)?h.then(function(e){switch(g=e,g.role){case"user":for(var f=0;f<g.Modules.length&&!(c=g.Modules[f].path);f++);break;case"admin":case"agent":c="/dashboard/voice"}c||(a.message="MESSAGE_NO_AVAILABLE_MODULES"),d(function(){b.path(c)},500)})["catch"](function(a){console.error(a),b.path("/login")}):void b.path("/login")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("landing",{url:"/landing",templateUrl:"app/landing/landing.html",controller:"LandingCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css","assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LoginCtrl",["$scope","Auth","$location","$window","$rootScope","Setting","xAlert","$stateParams",function(a,b,c,d,e,f,g,h){a.year=moment().year(),a.recovered=h.reset,a.userLogin={},a.userSignUp={},a.loginSubmitted=!1,a.signupSubmitted=!1,a.errorLogin=!1,a.errorSignup=!1,a.errorLog="",a.forgotPassword=!1,a.showRecoverMessage=!1,a.flagLogin1=!1,a.getInfo=function(){return f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},a.toggleLogin=function(){a.flagLogin1=!a.flagLogin1},a.toggleForgotPassword=function(b){a.showRecoverMessage=!1,a.userLogin.email="",a.forgotPassword=b},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.recover=function(){b.recover({email:a.userLogin.email}).then(function(){a.showRecoverMessage=!0})["catch"](function(b){console.log(b),a.showRecoverMessage=!1,g.error(b)})},a.login=function(d){a.loginSubmitted=!0,d.$valid?b.login({name:a.userLogin.name,password:a.userLogin.password,remember:a.userLogin.remember}).then(function(){c.path("/landing")})["catch"](function(b){a.errorLog=b.message||"error",a.errorLogin=!0}):a.errorLogin=!0},a.signup=function(c){a.signupSubmitted=!0,c.$valid?b.createUser({email:a.userSignUp.email,fullname:a.userSignUp.fullname,name:a.userSignUp.name,password:a.userSignUp.password,role:a.userSignUp.role,online:!0})["catch"](function(b){a.errorLog=b.message||"error",a.errorSignup=!0}):a.errorSignup=!0},a.loginOauth=function(a){d.location.href="/auth/"+a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("login",{url:"/login",templateUrl:"app/login/login.html",params:{reset:null},controller:"LoginCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Action",["$resource",function(a){return a("/api/actions/:name/:controller",{name:"@name"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Ami",["$resource",function(a){return a("/api/ami/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChooseContactModalCtrl",["$scope","$uibModalInstance","data","xAlert","$translate","Contact",function(a,b,c,d,e,f){function g(){return f.get({id:c.eventId,controller:"checkevent"}).$promise.then(function(b){a.contacts=b.rows})["catch"](function(a){d.error(a)})}function h(){return delete c.type,f.get(c).$promise.then(function(b){a.contacts=b.rows})["catch"](function(a){d.error(a)})}a.open=function(a){b.close(a)},a.getContacts=function(){switch(c.type){case"event":g();break;case"detail":h();break;default:b.dismiss("cancel")}},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalCtrl",["$scope","$uibModalInstance",function(a,b){a.close=function(){b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalJscriptyCtrl",["$scope","$uibModalInstance","project","JscriptyProject","xAlert",function(a,b,c,d,e){a.init=function(){a.project=c},a.close=function(){d.update({id:a.project.projectId,controller:"sessions",action:a.project.sessionId},{status:"incomplete",completedAt:Date(),last_question_id:a.project.lastQuestionId}).$promise.then(function(a){e.show("Project Ended","success")}),b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerSetDisposition",["$scope","$uibModalInstance","VoiceDisposition",function(a,b,c){a.initDisposition=function(){return c.get().$promise.then(function(b){a.dispositions=b.rows})["catch"](function(a){console.error(a)})},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("customGridDateFilterModalCtrl",["$scope","$rootScope","$log","$uibModalInstance","term","hasTime",function(a,b,c,d,e,f){if(a.hasTime=f,a.dateTime={},e)if(f){var g=e.split(" ");a.dateTime.filterDate=moment(g[0]),a.dateTime.time=e[1]?moment(g[1],"HH:mm"):moment()}else a.dateTime.filterDate=moment(e);else f&&(a.dateTime.time=moment());a.setFilterDate=function(b){d.close({date:moment(b).format("YYYY-MM-DD").toString(),time:f?a.dateTime.time?moment(a.dateTime.time).format("HH:mm").toString():moment().format("HH:mm").toString():null})},a.cancelDateFilter=function(){d.dismiss()}}]),angular.module("xCallyShuttleApp").controller("customGridTagsModalCtrl",["$scope","$rootScope","$log","$uibModalInstance","term","Tag","xAlert",function(a,b,c,d,e,f,g){a.initModal=function(){return a.item={},f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name"),a.item.myTags=e})["catch"](function(a){console.log("error retrieving tags"),g.error(a),d.dismiss()})},a.setFilterTags=function(){d.close(a.item.myTags)},a.cancelTagsFilter=function(){d.dismiss()}}]),angular.module("xCallyShuttleApp").factory("templateVariable",["$translate",function(a){return[{id:"voice",label:a.instant("APPLICATION_VOICE"),title:a.instant("APPLICATION_VOICE"),groups:[{label:a.instant("APPLICATION_QUEUE"),values:[{value:"{{uniqueid}}",label:a.instant("APPLICATION_UNIQUEID"),description:a.instant("APPLICATION_UNIQUEID")},{value:"{{calleridnum}}",label:a.instant("APPLICATION_CALLERIDNUM"),description:a.instant("APPLICATION_CALLERIDNUM")},{value:"{{calleridname}}",label:a.instant("APPLICATION_CALLERIDNAME"),description:a.instant("APPLICATION_CALLERIDNAME")},{value:"{{queue}}",label:a.instant("APPLICATION_QUEUE"),description:a.instant("APPLICATION_QUEUE")},{value:"{{interface}}",label:a.instant("APPLICATION_INTERFACE"),description:a.instant("APPLICATION_INTERFACE")},{value:"{{membername}}",label:a.instant("APPLICATION_MEMBERNAME"),description:a.instant("APPLICATION_MEMBERNAME")},{value:"{{holdtime}}",label:a.instant("APPLICATION_HOLDTIME"),description:a.instant("APPLICATION_HOLDTIME")},{value:"{{talktime}}",label:a.instant("APPLICATION_TALKTIME"),description:a.instant("APPLICATION_TALKTIME")},{value:"{{connectedlinenum}}",label:a.instant("APPLICATION_CONNECTEDLINENUM"),description:a.instant("APPLICATION_CONNECTEDLINENUM")},{value:"{{connectedlinename}}",label:a.instant("APPLICATION_CONNECTEDLINENAME"),description:a.instant("APPLICATION_CONNECTEDLINENAME")},{value:"{{agentconnectAt}}",label:a.instant("APPLICATION_CONNECTED_AT"),description:a.instant("APPLICATION_CONNECTED_AT")},{value:"{{agentcalledAt}}",label:a.instant("APPLICATION_CALLED_AT"),description:a.instant("APPLICATION_CALLED_AT")},{value:"{{agentcompleteAt}}",label:a.instant("APPLICATION_COMPLETED_AT"),description:a.instant("APPLICATION_AGENT_CALLED_AT")},{value:"{{reason}}",label:a.instant("APPLICATION_REASON"),description:a.instant("APPLICATION_REASON")},{value:"{{lastevent}}",label:a.instant("APPLICATION_LAST_EVENT"),description:a.instant("APPLICATION_LAST_EVENT")},{value:"{{channel}}",label:a.instant("APPLICATION_CHANNEL"),description:a.instant("APPLICATION_CHANNEL")}]}]},{id:"chat",label:a.instant("APPLICATION_CHAT"),title:a.instant("APPLICATION_CHAT"),groups:[{label:a.instant("APPLICATION_VARIABLES"),values:[{value:"{{username}}",label:a.instant("APPLICATION_USERNAME"),description:a.instant("APPLICATION_USERNAME")},{value:"{{email}}",label:a.instant("APPLICATION_MAIL"),description:a.instant("APPLICATION_MAIL")},{value:"{{text}}",label:a.instant("APPLICATION_TEXT"),description:a.instant("APPLICATION_TEXT")},{value:"{{chatWebsite}}",label:a.instant("APPLICATION_WEBSITE"),description:a.instant("APPLICATION_WEBSITE")}]}]},{id:"mail",label:a.instant("APPLICATION_MAIL"),title:a.instant("APPLICATION_MAIL"),groups:[{label:a.instant("APPLICATION_INTERACTION"),values:[{value:"{{interactionId}}",label:a.instant("APPLICATION_INTERACTION_ID"),description:a.instant("APPLICATION_INTERACTION_ID")},{value:"{{subject}}",label:a.instant("APPLICATION_SUBJECT"),description:a.instant("APPLICATION_SUBJECT")},{value:"{{{body}}}",label:a.instant("APPLICATION_MESSAGE"),description:a.instant("APPLICATION_MESSAGE")},{value:"{{accountName}}",label:a.instant("APPLICATION_ACCOUNT"),description:a.instant("APPLICATION_ACCOUNT")},{value:"{{from}}",label:"From",description:"From"},{value:"{{to}}",label:"To",description:"To"},{value:"{{cc}}",label:"Cc",description:"Cc"},{value:"{{agentName}}",label:a.instant("APPLICATION_AGENT_NAME"),description:a.instant("APPLICATION_AGENT_NAME")},{value:"{{agentEmail}}",label:a.instant("APPLICATION_AGENT_EMAIL"),description:a.instant("APPLICATION_AGENT_EMAIL")},{value:"{{createdAt}}",label:a.instant("APPLICATION_CREATED_AT"),description:a.instant("APPLICATION_CREATED_AT")}]}]}]}]),angular.module("xCallyShuttleApp").controller("gridDatePickerFilterCtrl",["$scope","$timeout","$uibModal","uiGridConstants",function(a,b,c,d){b(function(){a.col.colDef.name;a.openDatePicker=function(b){var d=c.open({templateUrl:"app/main/customDateFilter.modal.html",controller:"customGridDateFilterModalCtrl",size:"md",windowClass:"custom-date-filter-modal",resolve:{term:[function(){return b.term||null}],hasTime:b.hasTime||!1}});d.result.then(function(c){a.colFilter.listTerm=[],a.colFilter.term=c.date,b.hasTime&&(a.colFilter.term+=" "+c.time)})}})}]),angular.module("xCallyShuttleApp").factory("gridOptions",["Modal","xAlert","$translate","$interval","$q","usSpinnerService",function(a,b,c,d,e,f){return{gridOptions:function(d,g,h,i,j,k,l){function m(a,b){a.filter&&a.filter.term&&b&&(o[a.name]=a.filter.term),a.filters&&(a.filters.length>1?a.filters.forEach(function(b){b.term?64===b.condition?o[a.name+"_uiFrom"]=b.term:256===b.condition&&(o[a.name+"_uiTo"]=b.term):64===b.condition?delete o[a.name+"_uiFrom"]:256===b.condition&&delete o[a.name+"_uiTo"]}):a.filters.length&&a.filters[0].term?o[a.name]=a.filters[0].term:delete o[a.name])}h.id=[];var n=k?"gridOptions"+k:"gridOptions",o={offset:0,limit:10},p={offset:0,limit:10};g.draggable&&(g.rowTemplate='<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',g.useExternalPagination=!1,g.enablePaginationControls=!1,g.showGridFooter=!1);var q=function(a){var b=a&&a>h[n].paginationPageSize?h[n].paginationPageSize:a,c=b?30*b+120:177,d=angular.element(document.getElementsByName(n)).length?angular.element(document.getElementsByName(n)[0]):angular.element(document.getElementsByClassName("ui-grid")[0]);d.css("height",c+"px")},r=function(a,b){return h[n].enablePaginationControls||(delete o.offset,delete o.limit),f.spin("spinner-grid"),i=a||i,d=b||d,d.get(i?_.merge(o,i):o).$promise.then(function(a){h[n].totalItems=a.count,h[n].data=a.rows,q(a.rows.length),l&&l()})["catch"](function(a){console.error(a)})["finally"](function(){f.stop("spinner-grid")})};return h.deleteItem=a.confirm["delete"](function(a){var e=i?angular.copy(i):{};return _.merge(e,{id:a}),d.remove(e).$promise.then(function(){r(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.error(a)})}),h.deleteItems=a.confirm["delete"](function(){var a=i?angular.copy(i):{};return _.merge(a,{ids:h.id}),d["delete"](a).$promise.then(function(){r(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.error(a)})}),g.columnDefs.forEach(function(a){m(a,!0),a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){if(b.directive)a.cellTemplate+=b.directive;else{if(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="'+b.hide+'" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.uisref?' ui-sref="'+b.uisref+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",b.name)switch(b.name){case"delete":a.cellTemplate+='<i class="icon-trash"></i>';break;case"profile":case"settings":case"detail":case"embedding":a.cellTemplate+='<i class="icon-settings"></i>';break;case"view":a.cellTemplate+='<i class="icon-doc"></i>';break;case"clone":a.cellTemplate+='<i class="icon-docs"></i>';break;case"permits":a.cellTemplate+='<i class="icon-key"></i>';break;case"copy":a.cellTemplate+='<i class="fa fa-files-o"></i>';break;case"select":a.cellTemplate+='<i class="icon-check"></i>';break;case"preview":a.cellTemplate+='<i class="icon-magnifier"></i>';break;case"contacts":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"download":case"export":a.cellTemplate+='<i class="fa fa-download"></i>';break;case"agents":a.cellTemplate+='<i class="icon-people"></i>';break;case"run":a.cellTemplate+='<i class="fa fa-cogs"></i>';break;case"mailRoom":a.cellTemplate+='<i class="fa fa-envelope"></i>';break;case"chatRoom":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"faxRoom":a.cellTemplate+='<i class="icon-paper-plane"></i>';break;case"smsRoom":a.cellTemplate+='<i class="glyphicon glyphicon-comment"></i>';break;case"check":a.cellTemplate+='<i class="fa fa-check"></i>';break;case"queues":a.cellTemplate+='<i class="icon-docs"></i>';break;default:a.cellTemplate+="{{'APPLICATION_"+b.name.toUpperCase()+"' | translate}}"}else a.cellTemplate+=b.displayName?"{{'"+b.displayName+"' | translate}}":"";a.cellTemplate+="</a> "}}),a.cellTemplate+="<div>",delete a.buttons)}),_.merge({enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableRowSelection:!0,enableSelectAll:!0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,getPage:r,gridMenuTitleFilter:function(a){var b=e.defer();return b.resolve(c.instant(a)),b.promise},exporterAllDataFn:function(){return p.offset=o.offset,p.limit=o.limit,o={offset:0,limit:null},r().then(function(){o.offset=p.offset,o.limit=p.limit,r()})},exporterFieldCallback:function(a,b,c,d){if("applications"===c.field&&b.entity.Applications){var e="";return _.forEach(b.entity.Applications,function(a){e+=a.app+"("+a.appdata.join(",")+")"}),e}return d},exporterHeaderFilter:c.instant,onRegisterApi:function(a){h.gridApi=a,h.gridApi.selection&&(h.gridApi.selection.on.rowSelectionChanged(h,function(a){a.isSelected?h.id.push(h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id):_.pull(h.id,h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id)}),h.gridApi.selection.on.rowSelectionChangedBatch(h,function(a){a[0].isSelected?h.id=_.union(h.id,_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id")):_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id").forEach(function(a){_.pull(h.id,a)})})),h.gridApi.core.on.sortChanged(h,function(a,b){0===b.length?o.order=null:o.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),r()});for(var e=0;e<h.gridOptions.columnDefs.length;e++)if(h.gridOptions.columnDefs[e].hasOwnProperty("sort")){o.order=h.gridOptions.columnDefs[e].name+" "+h.gridOptions.columnDefs[e].sort.direction.toUpperCase();break}h.gridApi.pagination.on.paginationChanged(h,function(a,b){o.offset=(a-1)*b,o.limit=b,r()}),h.gridApi.core.on.filterChanged(h,function(){var a=this.grid;a.columns.forEach(function(a){m(a)}),r()}),h.gridApi.draggableRows&&h.gridApi.draggableRows.on.rowDropped(h,function(a){a.fromIndex!==a.toIndex&&d.update(i,h[n].data).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.error(a)})}),j||r()}},g)}}}]),angular.module("xCallyShuttleApp").controller("gridTagsFilterCtrl",["$scope","$timeout","$uibModal","uiGridConstants",function(a,b,c,d){b(function(){a.col.colDef.name;a.openTags=function(b){var d=c.open({templateUrl:"app/main/customTagsFilter.modal.html",controller:"customGridTagsModalCtrl",size:"md",resolve:{term:[function(){if(b.term){var a=b.term.split(";");return a.pop(),a}return[]}]}});d.result.then(function(b){a.colFilter.listTerm=[],b.length&&(a.colFilter.term=b.join(";")+";")})}})}]),angular.module("xCallyShuttleApp").controller("MainCtrl",["$scope","$rootScope","$translate","$timeout","socket","Auth","xAlert","$uibModal","$log","$state","Contact","$window","$location","localStorageService",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){function o(){b.activeTour={main:!1},b.tourConfig={main:[{type:"function",fn:function(){b.tempTourPath=m.path()}},{type:"title",heading:c.instant("TOUR_MAIN_WELCOME"),text:'<div class="row"><div id="title-text" class="col-md-12"><span class="main-text">'+c.instant("TOUR_MAIN_DISCOVER_MOTION")+"</span><br/></div></div>",curtainClass:"myCurtainClass"}]},(f.isAdmin()||b.userModules[1])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/dashboard/voice"},{type:"title",heading:c.instant("TOUR_MAIN_DASHBOARD"),text:c.instant("TOUR_MAIN_DASHBOARD_MESSAGE"),curtainClass:"myCurtainClass"}])),(f.isAdmin()||b.userModules[2])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/tools/yourdashboards/show/1"},{type:"title",heading:c.instant("TOUR_MAIN_YOURDASHBOARD"),text:c.instant("TOUR_MAIN_YOURDASHBOARD_MESSAGE"),curtainClass:"myCurtainClass"}])),(f.isAdmin()||b.userModules[4])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/staff/agents/list"},{type:"title",heading:c.instant("TOUR_MAIN_AGENTS"),text:c.instant("TOUR_MAIN_AGENTS_MESSAGE"),curtainClass:"myCurtainClass"}])),f.isAdmin()&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/channels/voice/queues/list"},{type:"title",heading:c.instant("TOUR_MAIN_VOICE_QUEUE"),text:c.instant("TOUR_MAIN_VOICE_QUEUE_ADD_MESSAGE"),curtainClass:"myCurtainClass"}])),b.license.chat&&(f.isAdmin()||b.userModules[8])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/channels/chat/queues/list"},{type:"title",heading:c.instant("TOUR_MAIN_CHAT_QUEUE"),text:c.instant("TOUR_MAIN_CHAT_QUEUE_MESSAGE"),curtainClass:"myCurtainClass"}])),b.license.openchannel&&(f.isAdmin()||b.userModules[20])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/channels/openchannel/accounts/list"},{type:"title",heading:c.instant("TOUR_MAIN_OPENCHANNEL"),text:c.instant("TOUR_MAIN_OPENCHANNEL_MESSAGE"),curtainClass:"myCurtainClass"}])),(f.isAdmin()||b.userModules[14])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/square/projects/list"},{type:"title",heading:c.instant("TOUR_MAIN_SQUARE_PROJECT"),text:c.instant("TOUR_MAIN_SQUARE_PROJECT_MESSAGE"),curtainClass:"myCurtainClass"}])),(f.isAdmin()||b.userModules[13])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/tools/trunks/list"},{type:"title",heading:c.instant("TOUR_MAIN_TRUNKS"),text:c.instant("TOUR_MAIN_TRUNKS_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/tools/triggers/list"},{type:"title",heading:c.instant("TOUR_MAIN_TRIGGERS"),text:c.instant("TOUR_MAIN__MESSAGE"),curtainClass:"myCurtainClass"}])),b.license.jscripty&&(f.isAdmin()||b.userModules[15])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/jscripty/projects/list"},{type:"title",heading:c.instant("TOUR_MAIN_JSCRIPTY"),text:c.instant("TOUR_MAIN_JSCRIPTY_MESSAGE"),curtainClass:"myCurtainClass"}])),(f.isAdmin()||b.userModules[17])&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/analytics/reports/list"},{type:"title",heading:c.instant("TOUR_MAIN_REPORTS"),text:c.instant("TOUR_MAIN_REPORTS_MESSAGE"),curtainClass:"myCurtainClass"}])),b.tourConfig.main=b.tourConfig.main.concat([{type:"title",heading:c.instant("TOUR_MAIN_END"),text:c.instant("TOUR_MAIN_END_MESSAGE"),curtainClass:"myCurtainClass"}])}a.awesomeThings=[],b.workspaces=[],a.Auth=f,b.userModules={},f.getCurrentUser().$promise.then(function(a){a.Modules.forEach(function(a){b.userModules[a.id]=!0}),o()})["catch"](function(a){g.error(a)}),b.onTourFinish=function(){n.set("skipTour",!0),b.tempTourPath&&m.path(b.tempTourPath)},b.onTourSkip=function(){n.set("skipTour",!0)},d(function(){n.get("skipTour")||(b.activeTour.main=!0)}),a.select=function(a){switch(a.type){case"chatRoom":case"mailRoom":case"faxRoom":a.unread=0}},e.socket.on("report_integration:tdDisposal",function(b){a.openTdTab(b)}),a.openTdTab=function(a){b.workspaces.push({type:"tdDisposal",name:"Motion Dialer Disposition","class":"icon-control-forward",active:!0,spooler:a})},a.deselect=function(){},a.isAdmin=f.isAdmin,a.isLoggedIn=f.isLoggedIn,a.getCurrentUser=f.getCurrentUser,a.CurrentUser=f.getCurrentUser(),e.socket.on("user_has_voice_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_chat_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_mail_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_fax_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_sms_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),a.mainTab={active:!0},a.closeJscriptyTab=function(a){if(b.workspaces[a].edited){var c=h.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.jscripty.html",controller:"CloseEditedTabModalJscriptyCtrl",resolve:{project:b.workspaces[a]}});c.result.then(function(){b.workspaces.splice(a,1)})}else b.workspaces.splice(a,1)},b.closeTab=function(a){var c;b.workspaces[a].edited?"jscripty"===b.workspaces[a].type?b.workspaces[a].end():(c=h.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.html",controller:"CloseEditedTabModalCtrl"}),c.result.then(function(){b.workspaces.splice(a,1)},function(){i.info("Modal dismissed at: "+new Date)})):b.workspaces.splice(a,1)},a.createContact=function(d,e){return e.CompanyId||delete e.CompanyId,k.save(e).$promise.then(function(e){b.workspaces.splice(d,1);var f=e.firstName;e.lastName&&(f+=" "+e.lastName),a.openContactTab({firstName:e.firstName,lastName:e.lastName,id:e.id}),g.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){g.error(a)})};var p=function(b){var c=h.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{data:function(){return{type:"event",eventId:b.id}}}});c.result.then(function(c){
-c?a.openContactTab(c,b):a.newContact(b)},function(){i.info("Modal dismissed at: "+new Date)})};a.updateContact=function(a,d){var e=angular.copy(d);return e.CompanyId||(e.CompanyId=null),k.update({id:e.id},e).$promise.then(function(){b.workspaces[a].edited=!1,g.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){g.error(a)})},e.socket.on("report_integration:contactmanager",function(a){p(a)}),e.socket.on("report_integration:jscripty",function(b){a.openJscriptyTab({name:"Jscripty",id:b.projectId,calleridnum:b.calleridnum,calleridname:b.calleridname,queue:b.queue,membername:b.membername})}),e.socket.on("report_integration:salesforce",function(a){l.open(a.url,"_blank")}),b.openContactTab=function(a,c){var d=_.find(b.workspaces,{contactID:a.id});if(d)d.active=!0;else{var e=a.firstName;a.lastName&&(e+=" "+a.lastName),b.workspaces.push({name:e,type:"contact",contactID:a.id,"class":"icon-user",active:!0,data:c||null})}},a.openJscriptyTab=function(a){b.workspaces.push({name:a.name,type:"jscripty",active:!0,data:a})},a.newContact=function(a){b.workspaces.push({name:"New Contact",type:"newContact","class":"icon-user",active:!0,data:a||null})},a.$on("$viewContentLoaded",function(){Metronic.init()}),b.language=c.use(),a.changeLanguage=function(a){return c.use(a).then(function(a){b.language=a,-1!==["main.jscripty.projects.view","main.square.projects.view"].indexOf(j.current.name)&&l.location.reload()})["catch"](function(a){console.error(a)})},a.$on("$destroy",function(){console.log("main $destroy"),e.unsyncUpdates("user_has_voice_queue_permit"),e.unsyncUpdates("user_has_chat_queue_permit"),e.unsyncUpdates("user_has_mail_queue_permit"),e.unsyncUpdates("user_has_fax_queue_permit"),e.unsyncUpdates("user_has_sms_queue_permit")})}]),angular.module("xCallyShuttleApp").directive("ngSpinnerBar",["$rootScope",function(a){return{link:function(b,c){c.addClass("hide"),a.$on("$stateChangeStart",function(){"spinner-page"===c[0].id&&c.removeClass("hide")}),a.$on("$stateChangeSuccess",function(){"spinner-page"===c[0].id&&(c.addClass("hide"),$("body").removeClass("page-on-load"),Layout.setSidebarMenuActiveLink("match"),setTimeout(function(){Metronic.scrollTop()},1e3))}),a.$on("$spinnerStart",function(){"spinner-request"===c[0].id&&c.removeClass("hide")}),a.$on("$spinnerStop",function(){"spinner-request"===c[0].id&&c.addClass("hide")}),a.$on("$stateNotFound",function(){"spinner-page"===c[0].id&&c.addClass("hide")}),a.$on("$stateChangeError",function(){"spinner-page"===c[0].id&&c.addClass("hide")})}}}]).directive("a",function(){return{restrict:"E",link:function(a,b,c){(c.ngClick||""===c.href||"#"===c.href)&&b.on("click",function(a){a.preventDefault()})}}}).directive("nxEqual",function(){return{require:"ngModel",link:function(a,b,c,d){return c.nxEqual?(a.$watch(c.nxEqual,function(a){d.$setValidity("nxEqual",a===d.$viewValue)}),void d.$parsers.push(function(b){var e=b===a.$eval(c.nxEqual);return d.$setValidity("nxEqual",e),e?b:void 0})):void console.error("nxEqual expects a model as an argument!")}}}).directive("ngEnter",function(){return function(a,b,c){b.bind("keydown keypress",function(b){13===b.which&&(a.$apply(function(){a.$eval(c.ngEnter)}),b.preventDefault())})}}).directive("dropdownMenuHover",function(){return{link:function(a,b){b.dropdownHover()}}}).directive("uiSelectRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.uiSelectRequired=function(a){return a&&a.length}}}}).directive("rpattern",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a,b){return null==b||""===b||!h||a.test(b)?(d.$setValidity("pattern",!0),b):void d.$setValidity("pattern",!1)}var f,g=c.rpattern,h=!0;g&&(g.match(/^\/(.*)\/$/)?(g=new RegExp(g.substr(1,g.length-2)),f=function(a){return e(g,a)}):f=function(b){var c=a.$eval(g);if(!c||!c.test)throw new Error("Expected "+g+" to be a RegExp but was "+c);return e(c,b)}),d.$formatters.push(f),d.$parsers.push(f),c.$observe("required",function(a){h=a,f(d.$viewValue)})}}}).directive("newContact",["$compile","xAlert","socket","$translate","$timeout","List","Tag","Company","ReportCall","$uibModal","$rootScope","Auth",function(a,b,c,d,e,f,g,h,i,j,k,l){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,m){return function(a,m,n){function o(){a.$watch("contact",function(b,c){angular.equals(b,c)||(a.workspace.edited=!0)},!0)}a.license=k.license,a.Auth=l,a.forms={general:{}},a.firstLoad=!0,a.detail={tab:"main"},a.contact={CompanyId:"",disposed:!1},a.submitButtonLabel=d.instant("APPLICATION_CONFIRM"),a.getAgent=function(){return l.getCurrentUser().$promise.then(function(b){a.agent=b})["catch"](function(a){b.error(a)})},a.callPhoneBar=function(c,e){var f;switch(e){case"call":f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c;break;case"transfer":f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/transfer?number="+c;break;default:f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c}return $http.get(f).success(function(){b.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){b.error(a)})},a.dispose=function(){return j.open({animation:!0,templateUrl:"app/main/cm.disposition.html",controller:"ContactManagerSetDisposition"}).result.then(function(c){return i.update({id:a.workspace.data.uniqueid},c).$promise.then(function(){a.contact.disposed=!0,b.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})})},a.init=function(){a.workspace.data&&(a.contact.firstName=a.workspace.data.calleridname?a.workspace.data.calleridname:a.workspace.data.messageId?a.workspace.data.messageId:a.workspace.data.uniqueid?a.workspace.data.uniqueid:"",a.workspace.data.calleridnum&&(a.contact.phone=a.workspace.data.calleridnum),a.workspace.data.from&&(a.contact.email=a.workspace.data.from)),a.getTags(),a.getCompanies(),a.getLists(),a.getAgent()},a.getLists=function(){return f.get().$promise.then(function(b){a.lists=b.rows,c.syncUpdates("list",a.lists),a.contact.ListId=a.lists[0]?a.lists[0].id:null,a.getCustomFields()})["catch"](function(a){b.error(a)})},a.getCustomFields=function(){return f.get({listId:a.contact.ListId,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ListId===a.contact.ListId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}}),!a.firstLoad||a.workspace.data?(a.workspace.edited=!0,a.firstLoad=!1):(a.firstLoad=!1,o())})["catch"](function(a){console.error(a),b.error(a)})},a.getTags=function(){return g.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.error(a)})},a.getCompanies=function(){return h.get().$promise.then(function(b){a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.error(a)})},e(function(){a.init()})}}}}]).directive("contact",["$compile","xAlert","socket","$timeout","List","Tag","Company","Contact","$translate","gridOptions","$uibModal","ReportCall","$rootScope","usSpinnerService","uiGridConstants","$log","Auth","$http",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,j){return function(a,j,s){function t(b){var c=[],d={};_.forEach(a.columns[a.log[b].show][a.log[b].detail].indexes,function(e,f){d={name:e,displayName:a.columns[a.log[b].show][a.log[b].detail].header[f],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},"createdAt"===e&&(d.cellTemplate="<div class=\"centered-uigrid-td\">{{row.entity.createdAt | date:'dd/MM/yyyy HH:mm:ss'}}</div>",d.filterHeaderTemplate='<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',d.filters=[{name:"From",condition:o.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:o.filter.LESS_THAN_OR_EQUAL}]),c.push(d)}),a.columns[a.log[b].show][a.log[b].detail].actions&&c.push(a.columns[a.log[b].show][a.log[b].detail].actions),c.forEach(function(a){u(a,b,!0),a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){if(b.directive)a.cellTemplate+=b.directive;else{if(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="'+b.hide+'" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.uisref?' ui-sref="'+b.uisref+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",b.name)switch(b.name){case"delete":a.cellTemplate+='<i class="fa fa-trash"></i>';break;case"profile":case"settings":case"detail":case"embedding":a.cellTemplate+='<i class="icon-settings"></i>';break;case"agents":a.cellTemplate+='<i class="icon-people"></i>';break;case"run":a.cellTemplate+='<i class="fa fa-cogs"></i>';break;case"mailRoom":a.cellTemplate+='<i class="fa fa-envelope"></i>';break;case"chatRoom":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"faxRoom":a.cellTemplate+='<i class="icon-paper-plane"></i>';break;case"smsRoom":a.cellTemplate+='<i class="glyphicon glyphicon-comment"></i>';break;default:a.cellTemplate+="{{'APPLICATION_"+b.name.toUpperCase()+"' | translate}}"}else a.cellTemplate+=b.displayName?"{{'"+b.displayName+"' | translate}}":"";a.cellTemplate+="</a> "}}),a.cellTemplate+="<div>",delete a.buttons)});var e={enablePaginationControls:!0,exporterCsvFilename:b+".csv",columnDefs:c,enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,showTreeExpandNoChildren:!0,data:[],gridMenuTitleFilter:function(a){var b=$q.defer();return b.resolve(i.instant(a)),b.promise},onRegisterApi:function(c){a.gridApi=c,a.gridApi.grid.registerDataChangeCallback(function(){}),a.gridApi.core.on.sortChanged(a,function(a,c){0===c.length?v.order=null:v.order=c[0].name+" "+c[0].sort.direction.toUpperCase(),w(b)}),a.gridApi.pagination.on.paginationChanged(a,function(a,c){v.offset=(a-1)*c,v.limit=c,w(b)}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){u(a,b)}),w(b)})}};w(b,e)}function u(a,b,c){a.filter&&a.filter.term&&c&&(v[b][a.name]=a.filter.term),a.filters&&(a.filters.length>1?a.filters.forEach(function(c){c.term?64===c.condition?v[b][a.name+"_uiFrom"]=c.term:256===c.condition&&(v[b][a.name+"_uiTo"]=c.term):64===c.condition?delete v[b][a.name+"_uiFrom"]:256===c.condition&&delete v[b][a.name+"_uiTo"]}):a.filters.length&&a.filters[0].term?v[b][a.name]=a.filters[0].term:delete v[b][a.name])}a.moment=moment,a.license=m.license,a.forms={general:{}},a.detail={tab:"main"},a.log={daily:{show:"phone",type:"inbound",detail:"general"},history:{show:"phone",type:"inbound",detail:"general"}},a.columns={phone:{general:{header:["APPLICATION_SOURCE","APPLICATION_DESTINATION","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["source","destination","disposition","createdAt"]},queue:{header:["APPLICATION_CALLERID","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["calleridnum","queue","createdAt"]}},email:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["from","account","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"mailRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'mailRoom')"}]}}},chat:{general:{header:["APPLICATION_WEBSITE","APPLICATION_VISITOR","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["website","contact","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"chatRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'chatRoom')"}]}}},fax:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["contact","account","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"faxRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'faxRoom')"}]}}},sms:{general:{header:["APPLICATION_FROM","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["contact","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"smsRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'smsRoom')"}]}}}},a.Auth=q,a.getAgent=function(){return q.getCurrentUser().$promise.then(function(b){a.agent=b})["catch"](function(a){b.error(a)})},a.callPhoneBar=function(c,d){var e;switch(d){case"call":e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c;break;case"transfer":e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/transfer?number="+c;break;default:e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c}return r.get(e).success(function(){b.show(i.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){b.error(a)})},a.copy=function(a){var c=k.open({animation:!0,size:"small",templateUrl:"app/contactmanager/contact/list/copy.modal.html",controller:"ContactManagerListCopyModalCtrl"});c.result.then(function(c){return h.save({id:a,controller:"copy"},c).$promise.then(function(a){m.openContactTab({firstName:a.firstName,lastName:a.lastName,id:a.id})})["catch"](function(a){b.error(a)})},function(){p.info("Modal dismissed at: "+new Date)})},a.merge=function(c){var d=k.open({animation:!0,size:"lg",templateUrl:"app/main/mergeContact.choose.modal.html",controller:"ContactManagerMergeContactChoose",resolve:{listId:c.ListId}});d.result.then(function(d){var e=k.open({animation:!0,size:"lg",templateUrl:"app/main/mergeContact.merge.modal.html",controller:"ContactManagerMergeContactMerge",resolve:{contactId:d,mergeContact:c}});e.result.then(function(e){return e.oldContact=c.id,h.save({id:d,controller:"merge"},e).$promise.then(function(b){m.workspaces.splice(a.index,1),_.remove(m.workspaces,{contactID:b.id}),m.openContactTab({firstName:b.firstName,lastName:b.lastName,id:b.id})})["catch"](function(a){b.error(a)})},function(){p.info("Modal dismissed at: "+new Date)})},function(){p.info("Modal dismissed at: "+new Date)})},a.dispose=function(){return k.open({animation:!0,templateUrl:"app/main/cm.disposition.modal.html",controller:"ContactManagerSetDisposition"}).result.then(function(c){return l.update({id:a.workspace.data.uniqueid},c).$promise.then(function(){a.contact.disposed=!0,b.show(i.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})})},a.companyInfo=function(b){k.open({animation:!0,size:"lg",templateUrl:"app/main/company.info.modal.html",controller:["$scope","$uibModalInstance","company",function(a,b,c){a.company=c,a.close=function(){b.dismiss("cancel")}}],resolve:{company:_.find(a.companies,{id:b})}})},a.updateLog=function(b,c,d,e){c&&(a.log[b].show=c),d&&(a.log[b].detail=d),e&&(a.log[b].type=e),t(b)},a.openRoom=function(a,b,c){var d=_.find(m.workspaces,{id:a,type:b});if(d)d.active=!0;else{var e;switch(b){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"}m.workspaces.push({id:a,type:b,"class":e,active:!0,data:c})}};var v={daily:{offset:0,limit:10},history:{offset:0,limit:10}},w=function(b,c){return n.spin("spinner-grid"),h.get(_.merge(_.merge({id:a.workspace.contactID,controller:"log",logType:b,order:"createdAt DESC"},a.log[b]),v[b])).$promise.then(function(d){c&&(a["gridOptions"+b]=c),a["gridOptions"+b].totalItems=d.count,a["gridOptions"+b].data=d.rows,x("gridOptions"+b,d.rows.length)})["catch"](function(a){console.error(a)})["finally"](function(){n.stop("spinner-grid")})},x=function(a,b){var c=b?30*b+120:177;angular.element(document.getElementsByName(a)[0]).css("height",c+"px")};a.getContact=function(){return h.get({id:a.workspace.contactID}).$promise.then(function(b){a.contact=b,a.contact.CompanyId||(a.contact.CompanyId=""),a.getCustomFields(b.ListId),a.updateLog("daily"),a.updateLog("history")})["catch"](function(a){console.error(a),b.error(a)})},a.getTags=function(){return f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.error(a)})},a.getCompanies=function(){return g.get().$promise.then(function(b){a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.error(a)})},a.getCustomFields=function(d){return a.customFields=[],e.get({listId:d,controller:"customfields"}).$promise.then(function(b){b.rows.forEach(function(b){try{"select"===b.type&&(b.values=JSON.parse(b.values)),a.customFields.push(b)}catch(c){console.log("Cf not valid:",b.alias)}}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ListId===d){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})})["catch"](function(a){console.error(a),b.error(a)})},d(function(){a.getTags(),a.getCompanies(),a.getContact(),a.getAgent()})}}}}]).directive("jscripty",["$compile","xAlert","$http","socket","JscriptyProject",function(a,b,c,d,e){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.jscriptyTab.html",compile:function(a,d){return function(a,d,f){a.count=0,a.questions=[];var g,h=a.workspace.data.id;c.get("/api/jscripty/projects/"+h+"/download").success(function(b){b?c.post("/api/jscripty/projects/"+h+"/sessions",{projectId:h,status:"started",queue:a.workspace.data.queue,calleridnum:a.workspace.data.calleridnum,callername:a.workspace.data.callername,membername:a.workspace.data.membername}).success(function(c){g=c.session_id,a.workspace.edited=!0,a.workspace.sessionId=g,a.workspace.projectId=h;var d=mxUtils.parseXml(b),e=new mxCodec(d);a.decObj=e.decode(d.documentElement);var f=_.find(a.decObj.cells,function(a){return a.vertex&&"start"==a.value.nodeName});if("OFF"==f.getAttribute("state")){var j=_.find(f.edges,function(a){return a.source.id==f.id}).target;a.questions[a.count]=a.currentQuestion=i(j)}else a.questions[a.count]=a.currentQuestion=f;a.saveQuestions()}):(console.log("No project published!"),alert("No project published!"),a.submit({index:a.index}))}),a.next=function(b,c){switch(a.currentQuestion.answer&&a.currentQuestion.answer!=c&&(a.questions=_.take(a.questions,a.count+1)),a.currentQuestion.answer=c,b.value.nodeName){case"question":b=i(b)}a.questions[a.count]=a.currentQuestion,a.currentQuestion=b,a.count++,a.questions[a.count]=b,a.saveQuestions()};var i=function(a){var b=[];return a.options=[],_.forEach(a.edges,function(c,d){if(c.source.id==a.id&&c.value){var e=String(c.value).split(",");e.length>1?(_.forEach(e,function(b,d){var e=Object.create(c);e.setValue(b),a.edges.push(e),a.options.push(b)}),b.push(c)):a.options.push(e[0])}}),_.forEach(b,function(b){_.remove(a.edges,function(a){return a.value==b.value&&a.id==b.id})}),a};a.end=function(){a.saveQuestions(),a.workspace.lastQuestionId=a.questions[a.questions.length-1].id,"end"==a.questions[a.questions.length-1].value.nodeName&&(a.workspace.edited=!1,e.update({id:h,controller:"sessions",action:g},{status:"completed",completedAt:Date(),last_question_id:a.questions[a.questions.length-1].id}).$promise.then(function(a){b.show("Project Ended","success")})),a.submit({index:a.index})},a.workspace.end=a.end,a.back=function(){a.count--,a.currentQuestion=a.questions[a.count]},a.setCurrentQuestion=function(b){a.count=b,a.currentQuestion=a.questions[a.count]},a.saveQuestions=function(){for(var c=[],d=[],f=0;f<a.questions.length;f++){if(a.questions[f].children)for(var i=a.questions[f].children,j=0;j<i.length;j++)d[j]={input_id:i[j].id,input_type:i[j].getAttribute("type"),input_label:i[j].getAttribute("label"),input_value:"checkbox"!=i[j].getAttribute("type")||i[j].answer?i[j].answer:!1};c[f]={sessionId:g,projectId:h,question_id:a.questions[f].id,question_type:a.questions[f].value.nodeName,question_label:a.questions[f].getAttribute("label"),question_text:a.questions[f].getAttribute("question")||a.questions[f].getAttribute("text"),question_other_label:a.questions[f].getAttribute("other"),question_other_answer:a.questions[f].otheranswer,question_answer:a.questions[f].answer,question_options:a.questions[f].options?JSON.stringify({options:a.questions[f].options}):null,index:f,ReportJscriptyInputs:d},d=[]}e.save({id:h,controller:"sessions",action:g,action2:"questions"},c).$promise.then(function(a){})["catch"](function(a){b.error(a)})}}}}}]).directive("reportBuilder",["$compile",function(a){return{restrict:"E",scope:{group:"=",fields:"=",forms:"=",firstCall:"="},templateUrl:"app/main/template/template.reportBuilderView.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){b.operators=[{name:"AND"},{name:"OR"}],b.conditions=[{name:"="},{name:"!="},{name:"<"},{name:"<="},{name:">"},{name:">="},{name:"LIKE"},{name:"NOT LIKE"},{name:"IS NULL"},{name:"IS NOT NULL"},{name:"IS EMPTY"},{name:"IS NOT EMPTY"}],b.inputIsRequired=function(a){if(a.condition)switch(a.condition){case"IS NULL":case"IS NOT NULL":case"IS EMPTY":case"IS NOT EMPTY":a.required=!1;break;default:a.required=!0}},b.addCondition=function(){b.group.rules.push({condition:"=",field:"",value:""})},b.removeCondition=function(a){b.group.rules.splice(a,1)},b.addGroup=function(){b.group.rules.push({group:{operator:"AND",rules:[{condition:"=",field:"",value:""}]}})},b.randomName=function(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.removeGroup=function(){b.$parent.group&&b.$parent.group.rules.splice(b.$parent.$index,1)},e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]).directive("dynamicName",["$compile",function(a){return{restrict:"A",terminal:!0,priority:1e3,link:function(b,c,d){c.attr("name",b.$eval(d.dynamicName)),c.removeAttr("dynamic-name"),a(c)(b)}}}]).directive("onReadFile",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e=a(d.onReadFile);c.on("change",function(a){var c=new FileReader;c.onload=function(a){b.$apply(function(){e(b,{$fileContent:a.target.result})})},c.readAsText((a.srcElement||a.target).files[0])})}}}]).directive("motionFileDownload",["xAlert","$translate","$timeout","$location","FileSaver","$compile",function(a,b,c,d,e,f){return{restrict:"E",template:'<a uib-tooltip=\'{{tooltiptext}}\' class="{{btnclass || \'btn default btn-xs blue-hoki\'}}" href="" data-ng-click="download()" ><i class="icon-cloud-download"></i>{{btncontent || \'\'}}</a>',scope:{mimetype:"=",filename:"=",resource:"=",params:"=",btnclass:"@",btncontent:"@",tooltiptext:"@"},link:function(b,c,d){var f=c.children()[0];b.$on("download-start",function(){$(f).attr("disabled","disabled")}),b.$on("downloaded",function(a,c){var d=base64ToBlob(c,b.mimetype);e.saveAs(d,b.filename),$(f).attr("disabled",!1)}),b.download=function(){return b.$emit("download-start"),b.resource.get(b.params).$promise.then(function(a){b.$emit("downloaded",a.downloadString)})["catch"](function(b){a.error(b),$(f).attr("disabled",!1)})}}}}]).directive("audioFileDownload",["xAlert","$translate","$uibModal",function(a,b,c){return{restrict:"E",template:'<button type="button" class="btn default btn-xs blue-hoki" data-ng-click="download()"><i class="fa fa-play"></i> {{ \'APPLICATION_PREVIEW\' | translate}}</button>',scope:{resource:"=",params:"="},link:function(b,d,e){var f=d.children()[0];b.$on("download-start",function(a,c){b.tempHtml=$(f).html(),$(f).attr("disabled","disabled").html('<i class="icon-refresh"></i> Loading...')}),b.$on("downloaded",function(a,d){c.open({animation:!0,size:"small",templateUrl:"app/main/audioFileDownload.play.modal.html",controller:["$scope","$uibModalInstance","$sce","audio",function(a,b,c,d){a.audio=c.trustAsResourceUrl("data:audio/wav;base64,"+d.data),a.close=function(){b.dismiss("cancel")}}],resolve:{audio:function(){return{data:d}}}});$(f).html(b.tempHtml).attr("disabled",!1)}),b.$on("error",function(a,c){$(f).html(b.tempHtml).attr("disabled",!1)}),b.download=function(){return b.$emit("download-start"),b.resource.get(b.params).$promise.then(function(a){b.$emit("downloaded",a.downloadString)})["catch"](function(c){a.error(c),b.$emit("error")})}}}}]).directive("uiRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.required=function(a,b){return!(b&&0===b.length&&"true"===c.uiRequired)},c.$observe("uiRequired",function(){d.$setValidity("required",!("true"===c.uiRequired&&d.$viewValue&&0===d.$viewValue.length))})}}}).directive("schrollBottom",function(){return{scope:{schrollBottom:"="},link:function(a,b){a.$watchCollection("schrollBottom",function(a){a&&$(b).scrollTop($(b)[0].scrollHeight)})}}}).directive("customGridDateFilterHeader",function(){return{templateUrl:"app/main/customDateFilterHeader.html",controller:"gridDatePickerFilterCtrl"}}).directive("customGridTagsFilterHeader",function(){return{templateUrl:"app/main/customTagsFilterHeader.html",controller:"gridTagsFilterCtrl"}}).directive("infiniteScroll",["$window",function(a){return{link:function(a,b,c){var d=parseInt(c.threshold)||0,e=b[0];b.bind("scroll",function(){a.$eval(c.canLoad)&&e.scrollTop+e.offsetHeight>=e.scrollHeight-d&&a.$apply(c.infiniteScroll)})}}}]).directive("tigerDialDisposal",["$compile","xAlert","socket","$translate","$timeout","$rootScope","MotionDialerSpooler","Agent",function(a,b,c,d,e,f,g,h){return{restrict:"E",scope:{workspace:"=",index:"="},templateUrl:"app/main/template/template.tigerDialDisposal.html",compile:function(a,c){return function(a,c,i){a.moment=moment,a.entitySpooler={},a.forms={td:{}},a.init=function(){return h.get().$promise.then(function(b){a.agents=[],b&&b.rows.forEach(function(b){a.agents.push("SIP/"+b.name)})})["catch"](function(a){b.error(a)})},a.save=function(){var c;switch(a.entitySpooler.retrieve){case"CLOSED":c=g.close({id:parseInt(a.workspace.ticketId.id)});break;case"OPEN":c=g.open({id:parseInt(a.workspace.ticketId.id)});break;case"BLACK_LIST":c=g.blacklist({id:parseInt(a.workspace.ticketId.id)});break;case"PLANNED":c=g.planning({id:parseInt(a.workspace.ticketId.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm")});break;case"PLANNED_PEER":c=g.planningpeer({id:parseInt(a.workspace.ticketId.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm"),peer:a.entitySpooler.planningpeer})}c?c.$promise.then(function(c){console.log(c),c.status>0?(b.show(d.instant("MESSAGE_WELL_DONE"),"success"),$uibModalInstance.close()):c.response.RMI.errors.forEach(function(c){c?(b.show(c.field+": "+c.error,"danger"),f.workspaces.splice(a.index,1)):b.show("Please, check your connection!","danger")})})["catch"](function(a){b.error(a)}):b.show("RETRIEVE NOT FOUND","danger")},e(function(){a.init()})}}}}]),angular.module("xCallyShuttleApp").filter("propsFilter",function(){return function(a,b){var c=[];return angular.isArray(a)?a.forEach(function(a){for(var d=!1,e=Object.keys(b),f=0;f<e.length;f++){var g=e[f],h=b[g].toLowerCase();if(-1!==a[g].toString().toLowerCase().indexOf(h)){d=!0;break}}d&&c.push(a)}):c=a,c}}).filter("capitalize",function(){return function(a){return a?a.replace(/([^\W_]+[^\s-]*) */g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}):""}}).filter("salesforce",function(){var a=["CallDisposition","CallDurationInSeconds","CallObject","CallType","IsArchived","Priority","Status","Type"];return function(b){return _.remove(b,function(b){return b.custom===!1&&a.indexOf(b.name)<0}),b}}).filter("sugarcrm",function(){var a=["account_id","account_name","account_name1","assigned_user_name","assigned_user_id","case_number","created_by","created_by_name","date_entered","date_modified","deleted","description","id","modified_by_name","modified_user_id","name"];return function(b){return _.remove(b,function(b){return a.indexOf(b.name)>=0}),b}}).filter("freshdesk",function(){var a=["requester","subject","agent","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.ticket_field.name)>=0}),b}}).filter("zendesk",function(){var a=["subject","assignee","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.type)>=0}),b}}).filter("slice",function(){return function(a,b,c){return a?a.slice(b,c):void 0}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main",{"abstract":!0,templateUrl:"app/main/main.html",controller:"MainCtrl",resolve:{authorization:["$q","Auth","$state","$timeout","$location",function(a,b,c,d,e){return b.getToken()?a.when():(d(function(){e.path("/login")}),a.reject())}],deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/ckeditor/ckeditor.js","assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("xAlert",["$translate","Notification","$state",function(a,b,c){return{show:function(c,d){switch(d){case"success":b.success({message:c,title:'<i class="glyphicon glyphicon-ok"></i> <strong>'+a.instant("MESSAGE_SUCCESS")+"!</strong>",delay:5e3});break;case"info":b.info({message:c,title:'<i class="glyphicon glyphicon-info-sign"></i> <strong>'+a.instant("MESSAGE_INFO")+"!</strong>",delay:5e3});break;case"danger":b.error({message:c,title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4});break;case"warning":b.warning({message:c,title:'<i class="glyphicon glyphicon-warning-sign"></i> <strong>'+a.instant("MESSAGE_WARNING")+"!</strong>",delay:1e4});break;default:b.info(c)}},error:function(d){var e,f;d?d.status&&401===d.status?(e="Unauthorized!",f=!0):e=d.data?d.data.translatedMessage||d.data.message||"Generic Error":d.translatedMessage||d.message||"Generic Error":e="Generic Error",b.error({message:a.instant(e),title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4}),f&&c.go("landing")}}}]).factory("stResource",["$q","$filter","$timeout","$rootScope","$http","$translate","xAlert",function(a,b,c,d,e,f,g){return{getPage:function(b){var c={page:Math.ceil(b.pagination.start/b.pagination.number),per_page:b.pagination.number};b.sort.predicate&&(c.sort_by=b.sort.predicate,c.sort_order=b.sort.reverse?"DESC":"ASC"),_.forIn(b.search.predicateObject,function(a,b){c[b]=a}),b.search.params&&(c.clientQuery={},_.forIn(b.search.params,function(a,b){c.clientQuery[b]=a})),d.$broadcast("$spinnerStart"),e.get(b.url,{params:c}).success(function(a){f.resolve(a),d.$broadcast("$spinnerStop")}).error(function(a){g.error(a),d.$broadcast("$spinnerStop")});var f=a.defer();return f.promise}}}]).factory("xNotification",["$translate","Notification","$rootScope",function(a,b,c){return{show:function(d,e,f,g,h,i){var j=c.$new(),k={message:e,
-title:d,templateUrl:"app/main/template/template.notification.html",delay:g,scope:j};switch(j.acceptBtn=a.instant("APPLICATION_ACCEPT"),j.rejectBtn=a.instant("APPLICATION_REJECT"),j.nAccept=h,j.nReject=i,f){case"chat":j["class"]="alert-info",j.icon="icon-bubble";break;case"mail":j["class"]="alert-success",j.icon="icon-envelope";break;case"fax":j["class"]="alert-warning",j.icon="icon-paper-plane";break;case"sms":j["class"]="alert-danger",j.icon="glyphicon glyphicon-comment";break;case"openchannel":j["class"]="alert-danger",j.icon="icon-globe";break;default:j["class"]="alert-info"}return new b(k)}}}]),angular.module("xCallyShuttleApp").controller("ContactManagerMergeContactChoose",["$scope","$translate","Contact","gridOptions","List","uiGridConstants","xAlert","$stateParams","Company","$uibModalInstance","listId",function(a,b,c,d,e,f,g,h,i,j,k){a.initView=function(){var b;return e.get().$promise.then(function(b){return a.lists=[],a.customFields=[],b.rows.forEach(function(b,c){_.forEach(b.CustomFields,function(b){a.customFields.push({name:b.name,alias:b.alias})}),a.lists.push({value:b.id,label:b.name})}),i.get().$promise}).then(function(b){a.companies=[],b.rows.forEach(function(b,c){a.companies.push({value:b.id,label:b.name})})}).then(function(){var e=[{"class":"blue-hoki",name:"select",onClick:"grid.appScope.choose(row.entity.id)"}];b={exporterCsvFilename:"Contacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"email"},{name:"ListId",displayName:"APPLICATION_LIST",field:"List.name",enableFiltering:!1},{name:"CompanyId",displayName:"APPLICATION_COMPANY",field:"Company.name",filter:{type:f.filter.SELECT,term:h.companyId||null,selectOptions:a.companies}}]},_.forEach(a.customFields,function(a){b.columnDefs.push({name:a.name,displayName:a.alias,visible:!1})}),b.columnDefs.push({name:"action",width:30,buttons:e}),a.gridOptions=d.gridOptions(c,b,a,{ListId:k})})["catch"](function(a){g.error(a)})},a.choose=function(a){j.close(a)},a.cancel=function(){j.dismiss()}}]),angular.module("xCallyShuttleApp").controller("ContactManagerMergeContactMerge",["$scope","$translate","Contact","xAlert","Company","$uibModalInstance","contactId","List","mergeContact","Tag",function(a,b,c,d,e,f,g,h,i,j){a.initView=function(){return e.get().$promise.then(function(b){return a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),j.get().$promise}).then(function(b){return a.tags=_.map(b.rows,"name"),c.get({id:g}).$promise}).then(function(b){a.fields={},a.contact={};var c=_.merge(_.keys(b),_.keys(i));return _.forEach(c,function(c){switch(c){case"tags":a.contact.tags=_.union(b.tags||[],i.tags||[]);break;case"$promise":case"$resolved":break;default:a.fields[c]=[],b[c]&&a.fields[c].push(b[c]),i[c]&&a.fields[c].push(i[c]),a.contact[c]=a.fields[c][0]||null}}),h.get({listId:b.ListId,controller:"customfields"}).$promise}).then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)})})["catch"](function(a){d.error(a)})},a.merge=function(){a.contact.CompanyId||(a.contact.CompanyId=null),f.close(a.contact)},a.cancel=function(){f.dismiss()}}]),angular.module("xCallyShuttleApp").factory("Widget",["$resource",function(a){return a("/api/widgets/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MarketCtrl",["$scope","$http","$translate","socket","xAlert","Modal","$timeout","Integration",function(a,b,c,d,e,f,g,h){function i(a,b){return Math.floor(Math.random()*(b-a+1))+a}a.initView=function(){return h.get().$promise.then(function(b){a.integrations=b.rows,a.groupedIntegration=_.chunk(a.integrations,4),d.syncUpdates("integration",a.integrations,function(){a.groupedIntegration=_.chunk(a.integrations,4)})})["catch"](function(a){e.error(a,"danger")})},a.isProgressing=!1,a.$on("$destroy",function(){d.unsyncUpdates("integration")}),a.installIntegration=function(b){return navigator.onLine?(a.status="Downloading",a.percentage=i(1,50),a.isProgressing=!0,b.downloading=!0,h.update({id:b.id},{active:!0}).$promise.then(function(){g(function(){a.percentage=i(51,99),a.status="Installing"},2500),g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",b.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)})["catch"](function(){b.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})):void e.show(c.instant("MESSAGE_NO_INTERNET_CONNECTION")+".","danger")},a.uninstallIntegration=function(b){return navigator.onLine?(a.status="Uninstalling",a.percentage=i(1,99),a.isProgressing=!0,b.downloading=!0,h.update({id:b.id},{active:!1}).$promise.then(function(){g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",b.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)})["catch"](function(){b.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})):void e.show(c.instant("MESSAGE_NO_INTERNET_CONNECTION")+".","danger")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.market",{url:"/market",templateUrl:"app/market/market.html",controller:"MarketCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MotionbarCtrl",["$scope","$stateParams","$cookieStore","$window","$location","Auth",function(a,b,c,d,e,f){console.log(b),b.token&&b.userId&&b.role&&b.redirectTo?(f.loginWithToken(b.token,b.userId,b.role),d.location.href=decodeURIComponent(b.redirectTo)):e.path("/login")}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("motionbar",{url:"/motionbar?redirectTo&token&userId&role",template:"<div ui-view></div>",controller:"MotionbarCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.blacklist",{url:"/blacklist",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerBlackListListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerBlackList","uiGridConstants",function(a,b,c,d,e,f,g){a.initView=function(){a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"phone"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.phone, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/blacklist/list/list.create.modal.html",controller:"MotionDialerBlackListListCreateCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerBlackListListCreateCtrl",["$scope","$translate","$uibModalInstance","MotionDialerBlackList","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.insert(a.item).$promise.then(function(a){a.status>0?(e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.blacklist.list",{url:"/list",templateUrl:"app/motiondialer/blacklist/list/list.html",controller:"MotionDialerBlackListListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerBlackList",["$resource",function(a){return a("/api/rest/blacklist/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.info",{url:"/info",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerSystem",["$resource",function(a){return a("/api/rest/system/:controller",null,{properties:{method:"POST",params:{controller:"properties"}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerInfoViewCtrl",["$scope","xAlert","MotionDialerSystem",function(a,b,c){a.getProperties=function(){return c.properties().$promise.then(function(c){console.log(c),c.status>0?a.properties=c.response.RMI:b.show(c.message||"Please, check your connection!","danger")})["catch"](function(a){b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.info.view",{url:"/view",templateUrl:"app/motiondialer/info/view/view.html",controller:"MotionDialerInfoViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.info.view.about",{url:"/about",templateUrl:"app/motiondialer/info/view/view.about.html"}).state("main.motiondialer.info.view.details",{url:"/details",templateUrl:"app/motiondialer/info/view/view.details.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists",{url:"/lists",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerListListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerList","uiGridConstants","usSpinnerService",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"name"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs blue-hoki" href="/motiondialer/lists/view/{{row.entity.id}}/settings"><i class="icon-settings"></i></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})["finally"](function(){h.stop("spinner-grid")})},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/list/list/list.create.modal.html",controller:"MotionDialerListListCreateCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerListListCreateCtrl",["$scope","$translate","$uibModalInstance","MotionDialerList","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.insert(a.item).$promise.then(function(a){a.status>0?(e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists.list",{url:"/list",templateUrl:"app/motiondialer/list/list/list.html",controller:"MotionDialerListListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerContact",["$resource",function(a){return a("/api/rest/contact/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").factory("MotionDialerList",["$resource",function(a){return a("/api/rest/list/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewContactCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerContact","xAlert","MotionDialerTimezone",function(a,b,c,d,e,f,g){a.form={},a.item={},a.timezones=g.list(),a.save=function(){return console.log(a.item),e.insert({id_list:parseInt(d.id),name:a.item.name,phones:a.item.phones.trim().split(","),description:a.item.description||""}).$promise.then(function(a){console.log(a),a.status>0?(f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):f.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerListContactImportModalCtrl",["$scope","$uibModalInstance","$stateParams","indexes","csv","xAlert","MotionDialerContact","MotionDialerTimezone",function(a,b,c,d,e,f,g,h){function i(b){if(b>=a.csvLength||a.stopped)return void(a.importing=!1);var d={id_list:parseInt(c.id),name:"",phones:[],description:""};return _.forOwn(a.item,function(a,c){"phones"===c?d[c].push(e[b][a]):d[c]=e[b][a]}),g.insert(d).$promise.then(function(b){b.status>0?(a["import"].success+=j,a["import"].succeeded++,k.push(b.response.RMI)):(console.log(b),a["import"].fail+=j,a["import"].failed++)})["catch"](function(b){console.log(b),a["import"].fail+=j,a["import"].failed++})["finally"](function(){i(b+1)})}a.form={},a.item={},a.timezones=h.list(),console.log(d),console.log(e),a.indexes=d,a.importing=!1,a.submitted=!1,a.stopped=!1,a["import"]={success:0,fail:0,succeeded:0,failed:0},a.csvLength=e.length;var j=100/a.csvLength,k=[];a.start=function(){a.importing=!0,a.submitted=!0,i(0)},a.close=function(){b.close(k)},a.stop=function(){a.stopped=!0}}]),angular.module("xCallyShuttleApp").controller("MotionDialerListViewCtrl",["$scope","$translate","$stateParams","$uibModal","xAlert","uiGridConstants","usSpinnerService","MotionDialerList","MotionDialerContact","Modal","FileUploader","Papa",function(a,b,c,d,e,f,g,h,i,j,k,l){a.getList=function(){return h.find({id:parseInt(c.id)}).$promise.then(function(b){b.status>0?a.list=b.response.RMI:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.updateList=function(){return h.update({id:a.list.id,name:a.list.name,description:a.list.description}).$promise.then(function(a){a.status>0?e.show(b.instant("MESSAGE_WELL_DONE"),"success"):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.getContacts=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"name"},{name:"phones",cellTemplate:"<div>{{row.entity.phones.join(',')}}</div>",cellClass:"ui-grid-vcenter"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:f.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteContact(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},i.list({id_list:parseInt(c.id),page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.deleteContact=j.confirm["delete"](function(c){return i["delete"]({id:c}).$promise.then(function(d){d.status>0?(_.remove(a.gridOptions.data,{id:c}),e.show(b.instant("MESSAGE_WELL_DONE"),"success")):e.show(d.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})}),a.createContact=function(){var b=d.open({animation:!0,templateUrl:"app/motiondialer/list/view/view.contact.create.modal.html",controller:"MotionDialerViewContactCreateCtrl"});b.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})};var m=a.uploader=new k({queueLimit:1,clearInputAfterAddedToQueue:!0});m.onAfterAddingFile=function(b){l.parse(b._file,{header:!0,complete:function(b){a.uploader.clearQueue(),a["import"](b.data)},error:function(a){e.error(a)}})},a["import"]=function(b){var c=d.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"app/motiondialer/list/view/view.contact.import.modal.html",controller:"MotionDialerListContactImportModalCtrl",resolve:{indexes:function(){return _.keys(b[0])},csv:function(){return b}}});c.result.then(function(b){console.log(b),a.gridOptions.data=a.gridOptions.data.concat(b)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists.view",{url:"/view/:id",templateUrl:"app/motiondialer/list/view/view.html",controller:"MotionDialerListViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.lists.view.settings",{url:"/settings",templateUrl:"app/motiondialer/list/view/view.settings.html"}).state("main.motiondialer.lists.view.contacts",{url:"/contacts",templateUrl:"app/motiondialer/list/view/view.contacts.html"})}]),angular.module("xCallyShuttleApp").factory("MotionDialerTimezone",function(){return{list:function(){return[{group:"US (Common)",zones:[{value:"America/Puerto_Rico",name:"Puerto Rico (Atlantic)"},{value:"America/New_York",name:"New York (Eastern)"},{value:"America/Chicago",name:"Chicago (Central)"},{value:"America/Denver",name:"Denver (Mountain)"},{value:"America/Phoenix",name:"Phoenix (MST)"},{value:"America/Los_Angeles",name:"Los Angeles (Pacific)"},{value:"America/Anchorage",name:"Anchorage (Alaska)"},{value:"Pacific/Honolulu",name:"Honolulu (Hawaii)"}]},{group:"America",zones:[{value:"America/Adak",name:"Adak"},{value:"America/Anchorage",name:"Anchorage"},{value:"America/Anguilla",name:"Anguilla"},{value:"America/Antigua",name:"Antigua"},{value:"America/Araguaina",name:"Araguaina"},{value:"America/Argentina/Buenos_Aires",name:"Argentina - Buenos Aires"},{value:"America/Argentina/Catamarca",name:"Argentina - Catamarca"},{value:"America/Argentina/ComodRivadavia",name:"Argentina - ComodRivadavia"},{value:"America/Argentina/Cordoba",name:"Argentina - Cordoba"},{value:"America/Argentina/Jujuy",name:"Argentina - Jujuy"},{value:"America/Argentina/La_Rioja",name:"Argentina - La Rioja"},{value:"America/Argentina/Mendoza",name:"Argentina - Mendoza"},{value:"America/Argentina/Rio_Gallegos",name:"Argentina - Rio Gallegos"},{value:"America/Argentina/Salta",name:"Argentina - Salta"},{value:"America/Argentina/San_Juan",name:"Argentina - San Juan"},{value:"America/Argentina/San_Luis",name:"Argentina - San Luis"},{value:"America/Argentina/Tucuman",name:"Argentina - Tucuman"},{value:"America/Argentina/Ushuaia",name:"Argentina - Ushuaia"},{value:"America/Aruba",name:"Aruba"},{value:"America/Asuncion",name:"Asuncion"},{value:"America/Atikokan",name:"Atikokan"},{value:"America/Atka",name:"Atka"},{value:"America/Bahia",name:"Bahia"},{value:"America/Barbados",name:"Barbados"},{value:"America/Belem",name:"Belem"},{value:"America/Belize",name:"Belize"},{value:"America/Blanc-Sablon",name:"Blanc-Sablon"},{value:"America/Boa_Vista",name:"Boa Vista"},{value:"America/Bogota",name:"Bogota"},{value:"America/Boise",name:"Boise"},{value:"America/Buenos_Aires",name:"Buenos Aires"},{value:"America/Cambridge_Bay",name:"Cambridge Bay"},{value:"America/Campo_Grande",name:"Campo Grande"},{value:"America/Cancun",name:"Cancun"},{value:"America/Caracas",name:"Caracas"},{value:"America/Catamarca",name:"Catamarca"},{value:"America/Cayenne",name:"Cayenne"},{value:"America/Cayman",name:"Cayman"},{value:"America/Chicago",name:"Chicago"},{value:"America/Chihuahua",name:"Chihuahua"},{value:"America/Coral_Harbour",name:"Coral Harbour"},{value:"America/Cordoba",name:"Cordoba"},{value:"America/Costa_Rica",name:"Costa Rica"},{value:"America/Cuiaba",name:"Cuiaba"},{value:"America/Curacao",name:"Curacao"},{value:"America/Danmarkshavn",name:"Danmarkshavn"},{value:"America/Dawson",name:"Dawson"},{value:"America/Dawson_Creek",name:"Dawson Creek"},{value:"America/Denver",name:"Denver"},{value:"America/Detroit",name:"Detroit"},{value:"America/Dominica",name:"Dominica"},{value:"America/Edmonton",name:"Edmonton"},{value:"America/Eirunepe",name:"Eirunepe"},{value:"America/El_Salvador",name:"El Salvador"},{value:"America/Ensenada",name:"Ensenada"},{value:"America/Fortaleza",name:"Fortaleza"},{value:"America/Fort_Wayne",name:"Fort Wayne"},{value:"America/Glace_Bay",name:"Glace Bay"},{value:"America/Godthab",name:"Godthab"},{value:"America/Goose_Bay",name:"Goose Bay"},{value:"America/Grand_Turk",name:"Grand Turk"},{value:"America/Grenada",name:"Grenada"},{value:"America/Guadeloupe",name:"Guadeloupe"},{value:"America/Guatemala",name:"Guatemala"},{value:"America/Guayaquil",name:"Guayaquil"},{value:"America/Guyana",name:"Guyana"},{value:"America/Halifax",name:"Halifax"},{value:"America/Havana",name:"Havana"},{value:"America/Hermosillo",name:"Hermosillo"},{value:"America/Indiana/Indianapolis",name:"Indiana - Indianapolis"},{value:"America/Indiana/Knox",name:"Indiana - Knox"},{value:"America/Indiana/Marengo",name:"Indiana - Marengo"},{value:"America/Indiana/Petersburg",name:"Indiana - Petersburg"},{value:"America/Indiana/Tell_City",name:"Indiana - Tell City"},{value:"America/Indiana/Vevay",name:"Indiana - Vevay"},{value:"America/Indiana/Vincennes",name:"Indiana - Vincennes"},{value:"America/Indiana/Winamac",name:"Indiana - Winamac"},{value:"America/Indianapolis",name:"Indianapolis"},{value:"America/Inuvik",name:"Inuvik"},{value:"America/Iqaluit",name:"Iqaluit"},{value:"America/Jamaica",name:"Jamaica"},{value:"America/Jujuy",name:"Jujuy"},{value:"America/Juneau",name:"Juneau"},{value:"America/Kentucky/Louisville",name:"Kentucky - Louisville"},{value:"America/Kentucky/Monticello",name:"Kentucky - Monticello"},{value:"America/Knox_IN",name:"Knox IN"},{value:"America/La_Paz",name:"La Paz"},{value:"America/Lima",name:"Lima"},{value:"America/Los_Angeles",name:"Los Angeles"},{value:"America/Louisville",name:"Louisville"},{value:"America/Maceio",name:"Maceio"},{value:"America/Managua",name:"Managua"},{value:"America/Manaus",name:"Manaus"},{value:"America/Marigot",name:"Marigot"},{value:"America/Martinique",name:"Martinique"},{value:"America/Matamoros",name:"Matamoros"},{value:"America/Mazatlan",name:"Mazatlan"},{value:"America/Mendoza",name:"Mendoza"},{value:"America/Menominee",name:"Menominee"},{value:"America/Merida",name:"Merida"},{value:"America/Mexico_City",name:"Mexico City"},{value:"America/Miquelon",name:"Miquelon"},{value:"America/Moncton",name:"Moncton"},{value:"America/Monterrey",name:"Monterrey"},{value:"America/Montevideo",name:"Montevideo"},{value:"America/Montreal",name:"Montreal"},{value:"America/Montserrat",name:"Montserrat"},{value:"America/Nassau",name:"Nassau"},{value:"America/New_York",name:"New York"},{value:"America/Nipigon",name:"Nipigon"},{value:"America/Nome",name:"Nome"},{value:"America/Noronha",name:"Noronha"},{value:"America/North_Dakota/Center",name:"North Dakota - Center"},{value:"America/North_Dakota/New_Salem",name:"North Dakota - New Salem"},{value:"America/Ojinaga",name:"Ojinaga"},{value:"America/Panama",name:"Panama"},{value:"America/Pangnirtung",name:"Pangnirtung"},{value:"America/Paramaribo",name:"Paramaribo"},{value:"America/Phoenix",name:"Phoenix"},{value:"America/Port-au-Prince",name:"Port-au-Prince"},{value:"America/Porto_Acre",name:"Porto Acre"},{value:"America/Port_of_Spain",name:"Port of Spain"},{value:"America/Porto_Velho",name:"Porto Velho"},{value:"America/Puerto_Rico",name:"Puerto Rico"},{value:"America/Rainy_River",name:"Rainy River"},{value:"America/Rankin_Inlet",name:"Rankin Inlet"},{value:"America/Recife",name:"Recife"},{value:"America/Regina",name:"Regina"},{value:"America/Resolute",name:"Resolute"},{value:"America/Rio_Branco",name:"Rio Branco"},{value:"America/Rosario",name:"Rosario"},{value:"America/Santa_Isabel",name:"Santa Isabel"},{value:"America/Santarem",name:"Santarem"},{value:"America/Santiago",name:"Santiago"},{value:"America/Santo_Domingo",name:"Santo Domingo"},{value:"America/Sao_Paulo",name:"Sao Paulo"},{value:"America/Scoresbysund",name:"Scoresbysund"},{value:"America/Shiprock",name:"Shiprock"},{value:"America/St_Barthelemy",name:"St Barthelemy"},{value:"America/St_Johns",name:"St Johns"},{value:"America/St_Kitts",name:"St Kitts"},{value:"America/St_Lucia",name:"St Lucia"},{value:"America/St_Thomas",name:"St Thomas"},{value:"America/St_Vincent",name:"St Vincent"},{value:"America/Swift_Current",name:"Swift Current"},{value:"America/Tegucigalpa",name:"Tegucigalpa"},{value:"America/Thule",name:"Thule"},{value:"America/Thunder_Bay",name:"Thunder Bay"},{value:"America/Tijuana",name:"Tijuana"},{value:"America/Toronto",name:"Toronto"},{value:"America/Tortola",name:"Tortola"},{value:"America/Vancouver",name:"Vancouver"},{value:"America/Virgin",name:"Virgin"},{value:"America/Whitehorse",name:"Whitehorse"},{value:"America/Winnipeg",name:"Winnipeg"},{value:"America/Yakutat",name:"Yakutat"},{value:"America/Yellowknife",name:"Yellowknife"}]},{group:"Europe",zones:[{value:"Europe/Amsterdam",name:"Amsterdam"},{value:"Europe/Andorra",name:"Andorra"},{value:"Europe/Athens",name:"Athens"},{value:"Europe/Belfast",name:"Belfast"},{value:"Europe/Belgrade",name:"Belgrade"},{value:"Europe/Berlin",name:"Berlin"},{value:"Europe/Bratislava",name:"Bratislava"},{value:"Europe/Brussels",name:"Brussels"},{value:"Europe/Bucharest",name:"Bucharest"},{value:"Europe/Budapest",name:"Budapest"},{value:"Europe/Chisinau",name:"Chisinau"},{value:"Europe/Copenhagen",name:"Copenhagen"},{value:"Europe/Dublin",name:"Dublin"},{value:"Europe/Gibraltar",name:"Gibraltar"},{value:"Europe/Guernsey",name:"Guernsey"},{value:"Europe/Helsinki",name:"Helsinki"},{value:"Europe/Isle_of_Man",name:"Isle of Man"},{value:"Europe/Istanbul",name:"Istanbul"},{value:"Europe/Jersey",name:"Jersey"},{value:"Europe/Kaliningrad",name:"Kaliningrad"},{value:"Europe/Kiev",name:"Kiev"},{value:"Europe/Lisbon",name:"Lisbon"},{value:"Europe/Ljubljana",name:"Ljubljana"},{value:"Europe/London",name:"London"},{value:"Europe/Luxembourg",name:"Luxembourg"},{value:"Europe/Madrid",name:"Madrid"},{value:"Europe/Malta",name:"Malta"},{value:"Europe/Mariehamn",name:"Mariehamn"},{value:"Europe/Minsk",name:"Minsk"},{value:"Europe/Monaco",name:"Monaco"},{value:"Europe/Moscow",name:"Moscow"},{value:"Europe/Nicosia",name:"Nicosia"},{value:"Europe/Oslo",name:"Oslo"},{value:"Europe/Paris",name:"Paris"},{value:"Europe/Podgorica",name:"Podgorica"},{value:"Europe/Prague",name:"Prague"},{value:"Europe/Riga",name:"Riga"},{value:"Europe/Rome",name:"Rome"},{value:"Europe/Samara",name:"Samara"},{value:"Europe/San_Marino",name:"San Marino"},{value:"Europe/Sarajevo",name:"Sarajevo"},{value:"Europe/Simferopol",name:"Simferopol"},{value:"Europe/Skopje",name:"Skopje"},{value:"Europe/Sofia",name:"Sofia"},{value:"Europe/Stockholm",name:"Stockholm"},{value:"Europe/Tallinn",name:"Tallinn"},{value:"Europe/Tirane",name:"Tirane"},{value:"Europe/Tiraspol",name:"Tiraspol"},{value:"Europe/Uzhgorod",name:"Uzhgorod"},{value:"Europe/Vaduz",name:"Vaduz"},{value:"Europe/Vatican",name:"Vatican"},{value:"Europe/Vienna",name:"Vienna"},{value:"Europe/Vilnius",name:"Vilnius"},{value:"Europe/Volgograd",name:"Volgograd"},{value:"Europe/Warsaw",name:"Warsaw"},{value:"Europe/Zagreb",name:"Zagreb"},{value:"Europe/Zaporozhye",name:"Zaporozhye"},{value:"Europe/Zurich",name:"Zurich"}]},{group:"Asia",zones:[{value:"Asia/Aden",name:"Aden"},{value:"Asia/Almaty",name:"Almaty"},{value:"Asia/Amman",name:"Amman"},{value:"Asia/Anadyr",name:"Anadyr"},{value:"Asia/Aqtau",name:"Aqtau"},{value:"Asia/Aqtobe",name:"Aqtobe"},{value:"Asia/Ashgabat",name:"Ashgabat"},{value:"Asia/Ashkhabad",name:"Ashkhabad"},{value:"Asia/Baghdad",name:"Baghdad"},{value:"Asia/Bahrain",name:"Bahrain"},{value:"Asia/Baku",name:"Baku"},{value:"Asia/Bangkok",name:"Bangkok"},{value:"Asia/Beirut",name:"Beirut"},{value:"Asia/Bishkek",name:"Bishkek"},{value:"Asia/Brunei",name:"Brunei"},{value:"Asia/Calcutta",name:"Calcutta"},{value:"Asia/Choibalsan",name:"Choibalsan"},{value:"Asia/Chongqing",name:"Chongqing"},{value:"Asia/Chungking",name:"Chungking"},{value:"Asia/Colombo",name:"Colombo"},{value:"Asia/Dacca",name:"Dacca"},{value:"Asia/Damascus",name:"Damascus"},{value:"Asia/Dhaka",name:"Dhaka"},{value:"Asia/Dili",name:"Dili"},{value:"Asia/Dubai",name:"Dubai"},{value:"Asia/Dushanbe",name:"Dushanbe"},{value:"Asia/Gaza",name:"Gaza"},{value:"Asia/Harbin",name:"Harbin"},{value:"Asia/Ho_Chi_Minh",name:"Ho Chi Minh"},{value:"Asia/Hong_Kong",name:"Hong Kong"},{value:"Asia/Hovd",name:"Hovd"},{value:"Asia/Irkutsk",name:"Irkutsk"},{value:"Asia/Istanbul",name:"Istanbul"},{value:"Asia/Jakarta",name:"Jakarta"},{value:"Asia/Jayapura",name:"Jayapura"},{value:"Asia/Jerusalem",name:"Jerusalem"},{value:"Asia/Kabul",name:"Kabul"},{value:"Asia/Kamchatka",name:"Kamchatka"},{value:"Asia/Karachi",name:"Karachi"},{value:"Asia/Kashgar",name:"Kashgar"},{value:"Asia/Kathmandu",name:"Kathmandu"},{value:"Asia/Katmandu",name:"Katmandu"},{value:"Asia/Kolkata",name:"Kolkata"},{value:"Asia/Krasnoyarsk",name:"Krasnoyarsk"},{value:"Asia/Kuala_Lumpur",name:"Kuala Lumpur"},{value:"Asia/Kuching",name:"Kuching"},{value:"Asia/Kuwait",name:"Kuwait"},{value:"Asia/Macao",name:"Macao"},{value:"Asia/Macau",name:"Macau"},{value:"Asia/Magadan",name:"Magadan"},{value:"Asia/Makassar",name:"Makassar"},{value:"Asia/Manila",name:"Manila"},{value:"Asia/Muscat",name:"Muscat"},{value:"Asia/Nicosia",name:"Nicosia"},{value:"Asia/Novokuznetsk",name:"Novokuznetsk"},{value:"Asia/Novosibirsk",name:"Novosibirsk"},{value:"Asia/Omsk",name:"Omsk"},{value:"Asia/Oral",name:"Oral"},{value:"Asia/Phnom_Penh",name:"Phnom Penh"},{value:"Asia/Pontianak",name:"Pontianak"},{value:"Asia/Pyongyang",name:"Pyongyang"},{value:"Asia/Qatar",name:"Qatar"},{value:"Asia/Qyzylorda",name:"Qyzylorda"},{value:"Asia/Rangoon",name:"Rangoon"},{value:"Asia/Riyadh",name:"Riyadh"},{value:"Asia/Saigon",name:"Saigon"},{value:"Asia/Sakhalin",name:"Sakhalin"},{value:"Asia/Samarkand",name:"Samarkand"},{value:"Asia/Seoul",name:"Seoul"},{value:"Asia/Shanghai",name:"Shanghai"},{value:"Asia/Singapore",name:"Singapore"},{value:"Asia/Taipei",name:"Taipei"},{value:"Asia/Tashkent",name:"Tashkent"},{value:"Asia/Tbilisi",name:"Tbilisi"},{value:"Asia/Tehran",name:"Tehran"},{value:"Asia/Tel_Aviv",name:"Tel Aviv"},{value:"Asia/Thimbu",name:"Thimbu"},{value:"Asia/Thimphu",name:"Thimphu"},{value:"Asia/Tokyo",name:"Tokyo"},{value:"Asia/Ujung_Pandang",
-name:"Ujung Pandang"},{value:"Asia/Ulaanbaatar",name:"Ulaanbaatar"},{value:"Asia/Ulan_Bator",name:"Ulan Bator"},{value:"Asia/Urumqi",name:"Urumqi"},{value:"Asia/Vientiane",name:"Vientiane"},{value:"Asia/Vladivostok",name:"Vladivostok"},{value:"Asia/Yakutsk",name:"Yakutsk"},{value:"Asia/Yekaterinburg",name:"Yekaterinburg"},{value:"Asia/Yerevan",name:"Yerevan"}]},{group:"Africa",zones:[{value:"Africa/Abidjan",name:"Abidjan"},{value:"Africa/Accra",name:"Accra"},{value:"Africa/Addis_Ababa",name:"Addis Ababa"},{value:"Africa/Algiers",name:"Algiers"},{value:"Africa/Asmara",name:"Asmara"},{value:"Africa/Asmera",name:"Asmera"},{value:"Africa/Bamako",name:"Bamako"},{value:"Africa/Bangui",name:"Bangui"},{value:"Africa/Banjul",name:"Banjul"},{value:"Africa/Bissau",name:"Bissau"},{value:"Africa/Blantyre",name:"Blantyre"},{value:"Africa/Brazzaville",name:"Brazzaville"},{value:"Africa/Bujumbura",name:"Bujumbura"},{value:"Africa/Cairo",name:"Cairo"},{value:"Africa/Casablanca",name:"Casablanca"},{value:"Africa/Ceuta",name:"Ceuta"},{value:"Africa/Conakry",name:"Conakry"},{value:"Africa/Dakar",name:"Dakar"},{value:"Africa/Dar_es_Salaam",name:"Dar es Salaam"},{value:"Africa/Djibouti",name:"Djibouti"},{value:"Africa/Douala",name:"Douala"},{value:"Africa/El_Aaiun",name:"El Aaiun"},{value:"Africa/Freetown",name:"Freetown"},{value:"Africa/Gaborone",name:"Gaborone"},{value:"Africa/Harare",name:"Harare"},{value:"Africa/Johannesburg",name:"Johannesburg"},{value:"Africa/Kampala",name:"Kampala"},{value:"Africa/Khartoum",name:"Khartoum"},{value:"Africa/Kigali",name:"Kigali"},{value:"Africa/Kinshasa",name:"Kinshasa"},{value:"Africa/Lagos",name:"Lagos"},{value:"Africa/Libreville",name:"Libreville"},{value:"Africa/Lome",name:"Lome"},{value:"Africa/Luanda",name:"Luanda"},{value:"Africa/Lubumbashi",name:"Lubumbashi"},{value:"Africa/Lusaka",name:"Lusaka"},{value:"Africa/Malabo",name:"Malabo"},{value:"Africa/Maputo",name:"Maputo"},{value:"Africa/Maseru",name:"Maseru"},{value:"Africa/Mbabane",name:"Mbabane"},{value:"Africa/Mogadishu",name:"Mogadishu"},{value:"Africa/Monrovia",name:"Monrovia"},{value:"Africa/Nairobi",name:"Nairobi"},{value:"Africa/Ndjamena",name:"Ndjamena"},{value:"Africa/Niamey",name:"Niamey"},{value:"Africa/Nouakchott",name:"Nouakchott"},{value:"Africa/Ouagadougou",name:"Ouagadougou"},{value:"Africa/Porto-Novo",name:"Porto-Novo"},{value:"Africa/Sao_Tome",name:"Sao Tome"},{value:"Africa/Timbuktu",name:"Timbuktu"},{value:"Africa/Tripoli",name:"Tripoli"},{value:"Africa/Tunis",name:"Tunis"},{value:"Africa/Windhoek",name:"Windhoek"}]},{group:"Australia",zones:[{value:"Australia/ACT",name:"ACT"},{value:"Australia/Adelaide",name:"Adelaide"},{value:"Australia/Brisbane",name:"Brisbane"},{value:"Australia/Broken_Hill",name:"Broken Hill"},{value:"Australia/Canberra",name:"Canberra"},{value:"Australia/Currie",name:"Currie"},{value:"Australia/Darwin",name:"Darwin"},{value:"Australia/Eucla",name:"Eucla"},{value:"Australia/Hobart",name:"Hobart"},{value:"Australia/LHI",name:"LHI"},{value:"Australia/Lindeman",name:"Lindeman"},{value:"Australia/Lord_Howe",name:"Lord Howe"},{value:"Australia/Melbourne",name:"Melbourne"},{value:"Australia/North",name:"North"},{value:"Australia/NSW",name:"NSW"},{value:"Australia/Perth",name:"Perth"},{value:"Australia/Queensland",name:"Queensland"},{value:"Australia/South",name:"South"},{value:"Australia/Sydney",name:"Sydney"},{value:"Australia/Tasmania",name:"Tasmania"},{value:"Australia/Victoria",name:"Victoria"},{value:"Australia/West",name:"West"},{value:"Australia/Yancowinna",name:"Yancowinna"}]},{group:"Indian",zones:[{value:"Indian/Antananarivo",name:"Antananarivo"},{value:"Indian/Chagos",name:"Chagos"},{value:"Indian/Christmas",name:"Christmas"},{value:"Indian/Cocos",name:"Cocos"},{value:"Indian/Comoro",name:"Comoro"},{value:"Indian/Kerguelen",name:"Kerguelen"},{value:"Indian/Mahe",name:"Mahe"},{value:"Indian/Maldives",name:"Maldives"},{value:"Indian/Mauritius",name:"Mauritius"},{value:"Indian/Mayotte",name:"Mayotte"},{value:"Indian/Reunion",name:"Reunion"}]},{group:"Atlantic",zones:[{value:"Atlantic/Azores",name:"Azores"},{value:"Atlantic/Bermuda",name:"Bermuda"},{value:"Atlantic/Canary",name:"Canary"},{value:"Atlantic/Cape_Verde",name:"Cape Verde"},{value:"Atlantic/Faeroe",name:"Faeroe"},{value:"Atlantic/Faroe",name:"Faroe"},{value:"Atlantic/Jan_Mayen",name:"Jan Mayen"},{value:"Atlantic/Madeira",name:"Madeira"},{value:"Atlantic/Reykjavik",name:"Reykjavik"},{value:"Atlantic/South_Georgia",name:"South Georgia"},{value:"Atlantic/Stanley",name:"Stanley"},{value:"Atlantic/St_Helena",name:"St Helena"}]},{group:"Pacific",zones:[{value:"Pacific/Apia",name:"Apia"},{value:"Pacific/Auckland",name:"Auckland"},{value:"Pacific/Chatham",name:"Chatham"},{value:"Pacific/Easter",name:"Easter"},{value:"Pacific/Efate",name:"Efate"},{value:"Pacific/Enderbury",name:"Enderbury"},{value:"Pacific/Fakaofo",name:"Fakaofo"},{value:"Pacific/Fiji",name:"Fiji"},{value:"Pacific/Funafuti",name:"Funafuti"},{value:"Pacific/Galapagos",name:"Galapagos"},{value:"Pacific/Gambier",name:"Gambier"},{value:"Pacific/Guadalcanal",name:"Guadalcanal"},{value:"Pacific/Guam",name:"Guam"},{value:"Pacific/Honolulu",name:"Honolulu"},{value:"Pacific/Johnston",name:"Johnston"},{value:"Pacific/Kiritimati",name:"Kiritimati"},{value:"Pacific/Kosrae",name:"Kosrae"},{value:"Pacific/Kwajalein",name:"Kwajalein"},{value:"Pacific/Majuro",name:"Majuro"},{value:"Pacific/Marquesas",name:"Marquesas"},{value:"Pacific/Midway",name:"Midway"},{value:"Pacific/Nauru",name:"Nauru"},{value:"Pacific/Niue",name:"Niue"},{value:"Pacific/Norfolk",name:"Norfolk"},{value:"Pacific/Noumea",name:"Noumea"},{value:"Pacific/Pago_Pago",name:"Pago Pago"},{value:"Pacific/Palau",name:"Palau"},{value:"Pacific/Pitcairn",name:"Pitcairn"},{value:"Pacific/Ponape",name:"Ponape"},{value:"Pacific/Port_Moresby",name:"Port Moresby"},{value:"Pacific/Rarotonga",name:"Rarotonga"},{value:"Pacific/Saipan",name:"Saipan"},{value:"Pacific/Samoa",name:"Samoa"},{value:"Pacific/Tahiti",name:"Tahiti"},{value:"Pacific/Tarawa",name:"Tarawa"},{value:"Pacific/Tongatapu",name:"Tongatapu"},{value:"Pacific/Truk",name:"Truk"},{value:"Pacific/Wake",name:"Wake"},{value:"Pacific/Wallis",name:"Wallis"},{value:"Pacific/Yap",name:"Yap"}]},{group:"Antarctica",zones:[{value:"Antarctica/Casey",name:"Casey"},{value:"Antarctica/Davis",name:"Davis"},{value:"Antarctica/DumontDUrville",name:"DumontDUrville"},{value:"Antarctica/Macquarie",name:"Macquarie"},{value:"Antarctica/Mawson",name:"Mawson"},{value:"Antarctica/McMurdo",name:"McMurdo"},{value:"Antarctica/Palmer",name:"Palmer"},{value:"Antarctica/Rothera",name:"Rothera"},{value:"Antarctica/South_Pole",name:"South Pole"},{value:"Antarctica/Syowa",name:"Syowa"},{value:"Antarctica/Vostok",name:"Vostok"}]},{group:"Arctic",zones:[{value:"Arctic/Longyearbyen",name:"Longyearbyen"}]},{group:"UTC",zones:[{value:"UTC",name:"UTC"}]},{group:"Manual Offsets",zones:[{value:"UTC-12",name:"UTC-12"},{value:"UTC-11",name:"UTC-11"},{value:"UTC-10",name:"UTC-10"},{value:"UTC-9",name:"UTC-9"},{value:"UTC-8",name:"UTC-8"},{value:"UTC-7",name:"UTC-7"},{value:"UTC-6",name:"UTC-6"},{value:"UTC-5",name:"UTC-5"},{value:"UTC-4",name:"UTC-4"},{value:"UTC-3",name:"UTC-3"},{value:"UTC-2",name:"UTC-2"},{value:"UTC-1",name:"UTC-1"},{value:"UTC+0",name:"UTC+0"},{value:"UTC+1",name:"UTC+1"},{value:"UTC+2",name:"UTC+2"},{value:"UTC+3",name:"UTC+3"},{value:"UTC+4",name:"UTC+4"},{value:"UTC+5",name:"UTC+5"},{value:"UTC+6",name:"UTC+6"},{value:"UTC+7",name:"UTC+7"},{value:"UTC+8",name:"UTC+8"},{value:"UTC+9",name:"UTC+9"},{value:"UTC+10",name:"UTC+10"},{value:"UTC+11",name:"UTC+11"},{value:"UTC+12",name:"UTC+12"},{value:"UTC+13",name:"UTC+13"},{value:"UTC+14",name:"UTC+14"}]}]}}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer",{url:"/motiondialer",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:16}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerProcess","uiGridConstants","usSpinnerService",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"name"},{name:"queue",enableSorting:!1},{name:"extension",enableSorting:!1},{name:"id_list",enableSorting:!1,cellTemplate:'<div><a class="btn btn-xs grey-cascade" href="/motiondialer/lists/view/{{row.entity.id_list}}/settings">{{row.entity.id_list}}</a></div>',cellClass:"ui-grid-vcenter"},{name:"status",cellTemplate:"<div><a class=\"btn btn-xs\" data-ng-class=\"row.entity.status == 'STOP' ? 'red-sunglo' : 'green-meadow'\" data-ng-href=\"#\">{{ (row.entity.status === 'RUN') ? 'RUNNING' : 'STOPPED'}}</a></div>",cellClass:"ui-grid-vcenter",filter:{type:g.filter.SELECT,selectOptions:[{value:"RUN",label:"RUNNING"},{value:"STOP",label:"STOPPED"}]}},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs blue-hoki" href="/motiondialer/processes/view/{{row.entity.id}}/overview"><i class="icon-settings"></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){console.log(b),b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})["finally"](function(){h.stop("spinner-grid")})},a.createProcessQueue=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/process/list/list.create.queue.modal.html",controller:"MotionDialerProcessListCreateQueueCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.createProcessSquare=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/process/list/list.create.square.modal.html",controller:"MotionDialerProcessListCreateSquareCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCreateQueueCtrl",["$scope","$translate","$uibModalInstance","MotionDialerProcess","MotionDialerList","Trunk","VoiceQueue","Route","xAlert",function(a,b,c,d,e,f,g,h,i){a.form={},a.item={fetch_sort:"ASC",timeout:3},a.initModal=function(){return g.get().$promise.then(function(b){return a.queues={},b&&(a.queues=b.rows),f.get().$promise}).then(function(b){return a.trunks={},b&&(a.trunks=b.rows),a.trunks.push({name:"fake"}),e.list({page:1,size:6e5}).$promise}).then(function(b){a.lists={},b.status>0?a.lists=b.response.RMI.rows:i.show("Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.save=function(){console.log(a.item);var e="process_"+a.item.name+"_queue_"+a.item.queue.name+"_"+Math.round(1e5*Math.random()),f="Generated by Motion Dialer, Process Queue"+(a.item.description?", "+a.item.description:"");return h.save({appdata:"Internal Call",context:"from-sip",exten:e.replace(/\s/g,"_"),type:"internal",description:f,Applications:[{appdata:["CDR(type)=tigerdial"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:["QUEUE_PRIO=99"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:[a.item.queue.name,"","","",a.item.timeout],app:"Queue",interval:"*,*,*,*",type:"internal"}]}).$promise.then(function(b){return console.log(b),d.insert({name:a.item.name,id_list:a.item.list.id,queue:a.item.queue.name,device:a.item.device.name,context:"from-sip",extension:e.replace(/\s/g,"_"),description:a.item.description,auto_closed:!0,fetch_sort:a.item.fetch_sort}).$promise}).then(function(a){a.status>0?(i.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):i.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCreateSquareCtrl",["$scope","$translate","$uibModalInstance","MotionDialerProcess","MotionDialerList","SquareProject","Trunk","Route","xAlert",function(a,b,c,d,e,f,g,h,i){a.form={},a.item={fetch_sort:"ASC"},a.initModal=function(){return f.get().$promise.then(function(b){return a.projects={},b&&(a.projects=b.rows),g.get().$promise}).then(function(b){return a.trunks={},b&&(a.trunks=b.rows),a.trunks.push({name:"fake"}),e.list({page:1,size:6e5}).$promise}).then(function(b){a.lists={},b.status>0?a.lists=b.response.RMI.rows:i.show("Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.save=function(){console.log(a.item);var e="process_"+a.item.name+"_square_"+a.item.project.name+"_"+Math.round(1e5*Math.random()),f="Generated by Motion Dialer, Process Square"+(a.item.description?", "+a.item.description:"");return h.save({appdata:"Internal Call",context:"from-sip",exten:e.replace(/\s/g,"_"),type:"internal",description:f,Applications:[{appdata:["CDR(type)=tigerdial"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:["agi://127.0.0.1/square",a.item.project.name],app:"AGI",interval:"*,*,*,*",type:"internal"}]}).$promise.then(function(b){return console.log(b),d.insert({name:a.item.name,id_list:a.item.list.id,queue:"none",device:a.item.device.name,context:"from-sip",extension:e.replace(/\s/g,"_"),description:a.item.description,auto_closed:!0,channel_limit:15,fetch_sort:a.item.fetch_sort}).$promise}).then(function(a){a.status>0?(i.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):i.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes.list",{url:"/list",templateUrl:"app/motiondialer/process/list/list.html",controller:"MotionDialerProcessListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerProcess",["$resource",function(a){return a("/api/rest/process/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").factory("MotionDialerSpooler",["$resource",function(a){return a("/api/rest/spooler/:controller/:retrieve/:peer",null,{list:{method:"POST",params:{controller:"list"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},summary:{method:"POST",params:{controller:"summary"}},close:{method:"POST",params:{controller:"retrieve",retrieve:"close"}},open:{method:"POST",params:{controller:"retrieve",retrieve:"open"}},blacklist:{method:"POST",params:{controller:"retrieve",retrieve:"blacklist"}},planning:{method:"POST",params:{controller:"retrieve",retrieve:"planning"}},planningpeer:{method:"POST",params:{controller:"retrieve",retrieve:"planning",peer:"peer"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes",{url:"/processes",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessViewCtrl",["$scope","$translate","$stateParams","$uibModal","xAlert","uiGridConstants","usSpinnerService","MotionDialerProcess","MotionDialerSpooler","Modal","VoiceQueue",function(a,b,c,d,e,f,g,h,i,j,k){a.process={},a.techs=["SIP","IAX","LOCAL","KHOMP"],a.dialFormats=["tech/device/number","tech/number@device"],a.checkDuplicates=["ALWAYS","IFOPEN","NO"],a.codecs=["g729","ilbc","gsm","ulaw","alaw"],a.getProcess=function(){return h.find({id:parseInt(c.id)}).$promise.then(function(b){console.log(b),b.status>0?(b.response.RMI.codecs=b.response.RMI.codecs.split(","),a.process=b.response.RMI):e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.getSummary=function(){return i.summary({id_process:parseInt(c.id)}).$promise.then(function(b){if(b.status>0){a.summary=b.response.RMI.totals,a.total=0;for(var c=0;c<a.summary.length;c++)a.total+=a.summary[c][1]}else e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.updateProcess=function(){var c=_.clone(a.process);return delete c.updatedtime,delete c.id_list,delete c.createdtime,delete c.runtime,delete c.fetch_sort,c.codecs=c.codecs.join(","),""===c.timezone&&delete c.timezone,h.update(c).$promise.then(function(c){c.status>0?(c.response.RMI.codecs=c.response.RMI.codecs.split(","),a.process=c.response.RMI,e.show(b.instant("MESSAGE_WELL_DONE"),"success")):c.response.RMI.errors.forEach(function(a){a?e.show(a.field+": "+a.error,"danger"):e.show("Please, check your connection!","danger")})})["catch"](function(a){e.error(a)})},a.getSpooler=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,headerCellFilter:"translate",columnDefs:[{name:"name"},{name:"phones",cellTemplate:"<div>{{row.entity.phones.join(',')}}</div>",cellClass:"ui-grid-vcenter"},{name:"retrieve",filter:{type:f.filter.SELECT,selectOptions:[{value:"PLANNED_PEER",label:"PLANNED PEER"},{value:"PLANNED",label:"PLANNED"},{value:"BLACK_LIST",label:"BLACKLIST"},{value:"OPEN",label:"OPEN"},{value:"CLOSED",label:"CLOSED"},{value:"MAX_ATTEMPTS",label:"MAX ATTEMPTS"},{value:"COUNTER_BLOCK",label:"COUNTER BLOCK"},{value:"PLANNED_REQUEST",label:"PLANNED REQUEST"},{value:"DELETE",label:"DELETE"}]}},{name:"counter",enableFiltering:!1},{name:"planningtime",cellTemplate:"<div>{{row.entity.planningtime | date:'yyyy-MM-dd HH:mm'}}</div>",cellClass:"ui-grid-vcenter",enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs green" data-ng-click="grid.appScope.historySpooler(row.entity.history)"><i class="icon-info"></i></a> <a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.editSpooler(row.entity)"><i class="icon-settings"></i></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteSpooler(row.entity.phones.join(), row.entity.id)"><i class="fa fa-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},i.list({id_process:parseInt(c.id),page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.deleteSpooler=j.confirm["delete"](function(c){return i["delete"]({id:c}).$promise.then(function(d){d.status>0?(_.remove(a.gridOptions.data,{id:c}),e.show(b.instant("MESSAGE_WELL_DONE"),"success")):e.show(d.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})}),a.historySpooler=function(b){var c=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.spooler.history.modal.html",controller:"MotionDialerViewSpoolerHistoryCtrl",resolve:{historySpooler:function(){return b}}});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.editSpooler=function(a){var b=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.spooler.edit.modal.html",controller:"MotionDialerViewSpoolerEditCtrl",resolve:{entitySpooler:function(){return a}}});b.result.then(function(){})},a.initSettings=function(){return a.queues=null,k.get().$promise.then(function(b){b&&(a.queues=b.rows,a.process.queue&&"none"!==a.process.queue&&(a.queue=_.find(b.rows,{name:a.process.queue})))})["catch"](function(a){e.error(a)})},a.createInterval=function(b){var c=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.create.interval.modal.html",controller:"MotionDialerViewCreateIntervalCtrl",resolve:{objectProcess:function(){return a.process},intervalType:function(){return b},intervalValue:function(){return b?"8:00-20:00|MON-FRI|*|*":"00:01-07:59|SAT-SUN|*|*"}}});c.result.then(function(b){a.process=b})},a.editInterval=function(b,c){var e=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.create.interval.modal.html",controller:"MotionDialerViewCreateIntervalCtrl",resolve:{objectProcess:function(){return a.process},intervalType:function(){return b},intervalValue:function(){return c}}});e.result.then(function(b){a.process=b})},a.deleteInterval=j.confirm["delete"](function(c,d){var f={id:a.process.id};return d?(f.intervals=[],f.intervals=f.intervals.concat(a.process.intervals),f.intervals.splice(c,1)):(f.not_intervals=[],f.not_intervals=f.not_intervals.concat(a.process.not_intervals),f.not_intervals.splice(c,1)),h.update(f).$promise.then(function(c){c.status>0?(c.response.RMI.codecs=c.response.RMI.codecs.split(","),a.process=c.response.RMI,e.show(b.instant("MESSAGE_WELL_DONE"),"success")):c.response.RMI.errors.forEach(function(a){a?e.show(a.field+": "+a.error,"danger"):e.show("Please, check your connection!","danger")})})["catch"](function(a){e.error(a)})}),a.runOrStop=function(){var b=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.run.process.modal.html",controller:"MotionDialerViewRunProcessCtrl",resolve:{statusProcess:function(){return a.process.status}}});b.result.then(function(b){a.process.status=b.status})}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewCreateIntervalCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerProcess","xAlert","objectProcess","intervalType","intervalValue","interval",function(a,b,c,d,e,f,g,h,i,j){function k(a){var b,c=a.split("|"),d={};return c.forEach(function(a,c){switch(c){case 0:"*"!==a?(b=a.split("-"),d.t_from=moment(b[0],"HH:mm"),d.t_to=moment(b[1],"HH:mm"),d.alwaysTime=!1):(d.t_from=moment(new Date),d.t_to=moment(new Date),d.alwaysTime=!0);break;case 1:"*"!==a?(b=a.split("-"),d.wd_from=b[0].toLowerCase(),d.wd_to=b[1]?b[1].toLowerCase():"always"):(d.wd_from="always",d.wd_to="always");break;case 2:"*"!==a?(b=a.split("-"),d.md_from=b[0],d.md_to=b[1]?b[1]:"always"):(d.md_from="always",d.md_to="always");break;case 3:"*"!==a?(b=a.split("-"),d.m_from=b[0],d.m_to=b[1]?b[1]:"always"):(d.m_from="always",d.m_to="always")}}),d}function l(a){var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from.toUpperCase(),a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to.toUpperCase())):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from,a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to)):e="*",b+"|"+c+"|"+d+"|"+e}a.form={},a.$interval=j.interval,a.splittedInterval=k(i),a.save=function(){var d=l(a.splittedInterval);console.log(d);var i={id:g.id};return h?(i.intervals=[],i.intervals=i.intervals.concat(g.intervals),i.intervals.push(d)):(i.not_intervals=[],i.not_intervals=i.not_intervals.concat(g.not_intervals),i.not_intervals.push(d)),console.log(i),e.update(i).$promise.then(function(a){a.status>0?(a.response.RMI.codecs=a.response.RMI.codecs.split(","),f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a.response.RMI)):a.response.RMI.errors.forEach(function(a){a?f.show(a.field+": "+a.error,"danger"):f.show("Please, check your connection!","danger")})})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes.view",{url:"/view/:id",templateUrl:"app/motiondialer/process/view/view.html",controller:"MotionDialerProcessViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.processes.view.overview",{url:"/overview",templateUrl:"app/motiondialer/process/view/view.overview.html"}).state("main.motiondialer.processes.view.settings",{url:"/settings",templateUrl:"app/motiondialer/process/view/view.settings.html"}).state("main.motiondialer.processes.view.intervals",{url:"/intervals",templateUrl:"app/motiondialer/process/view/view.intervals.html"}).state("main.motiondialer.processes.view.spooler",{url:"/spooler",templateUrl:"app/motiondialer/process/view/view.spooler.html"})}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewRunProcessCtrl",["$scope","$stateParams","$uibModalInstance","$translate","statusProcess","MotionDialerProcess","xAlert",function(a,b,c,d,e,f,g){a.status="RUN"===e?"STOP":"RUN",a.yes=function(){f.update({id:parseInt(b.id),status:a.status}).$promise.then(function(a){a.status>0?(g.show(d.instant("MESSAGE_WELL_DONE"),"success"),c.close(a.response.RMI)):g.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){g.error(a)})},a.no=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewSpoolerEditCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerSpooler","xAlert","entitySpooler","Agent",function(a,b,c,d,e,f,g,h){a.moment=moment,a.initModal=function(){return h.get().$promise.then(function(b){a.agents=[],b&&b.rows.forEach(function(b){a.agents.push("SIP/"+b.name)})})["catch"](function(a){f.error(a)})},a.entitySpooler=g,a.save=function(){var d;switch(a.entitySpooler.retrieve){case"CLOSED":d=e.close({id:parseInt(a.entitySpooler.id)});break;case"OPEN":d=e.open({id:parseInt(a.entitySpooler.id)});break;case"BLACK_LIST":d=e.blacklist({id:parseInt(a.entitySpooler.id)});break;case"PLANNED":d=e.planning({id:parseInt(a.entitySpooler.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm")});break;case"PLANNED_PEER":d=e.planningpeer({id:parseInt(a.entitySpooler.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm"),peer:a.entitySpooler.planningpeer})}d?d.$promise.then(function(a){console.log(a),a.status>0?(f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close()):a.response.RMI.errors.forEach(function(a){a?f.show(a.field+": "+a.error,"danger"):f.show("Please, check your connection!","danger")})})["catch"](function(a){f.error(a)}):f.show("RETRIEVE NOT FOUND","danger")},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewSpoolerHistoryCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerSpooler","xAlert","historySpooler",function(a,b,c,d,e,f,g){a.historySpooler=g,a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("ResetCtrl",["$scope","Auth","$location","$window","$rootScope","Setting","xAlert","$stateParams","$state",function(a,b,c,d,e,f,g,h,i){a.userReset={},a.getInfo=function(){return f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.reset=function(){b.reset({token:h.token,password:a.userReset.password}).then(function(){i.go("login",{reset:!0})})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("reset",{url:"/reset/:token",templateUrl:"app/reset/reset.html",controller:"ResetCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("SalesforceListCtrl",["$scope","SalesforceAccount","gridOptions","xAlert","$translate",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"salesforce_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_URI"},{name:"action",buttons:[{"class":"blue-hoki",href:"/salesforce/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.salesforce.list",{url:"/list",templateUrl:"app/salesforce/list/list.html",controller:"SalesforceListCtrl",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").factory("SalesforceAccount",["$resource",function(a){return a("/api/salesforce/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"},fields:{params:{controller:"fields"},isArray:!0},check:{params:{controller:"check"}}})}]).factory("SalesforceConfiguration",["$resource",function(a){return a("/api/salesforce/accounts/:accountId/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]).factory("SalesforceField",["$resource",function(a){return a("/api/salesforce/accounts/:accountId/configurations/:configurationId/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce",{url:"/salesforce",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view.configurations",{url:"/configurations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewConfigurationListCtrl",["$scope","$stateParams","$translate","gridOptions","SalesforceConfiguration","$uibModal",function(a,b,c,d,e,f){a.initView=function(){var c={exporterCsvFilename:"salesforce_configurations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/salesforce/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/salesforce/view/configuration/list/create.modal.html",controller:"SalesforceCreateConfigurationCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SalesforceCreateConfigurationCtrl",["$scope","$translate","$uibModalInstance","SalesforceConfiguration","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.salesforce.view.configurations.list",{url:"/list",templateUrl:"app/salesforce/view/configuration/list/list.html",controller:"SalesforceViewConfigurationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewConfigurationViewCtrl",["$scope","$filter","$stateParams","$translate","socket","variable","xAlert","SalesforceAccount","SalesforceConfiguration","SalesforceField","Variable",function(a,b,c,d,e,f,g,h,i,j,k){
-a.$on("$destroy",function(){e.unsyncUpdates("salesforce_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";default:return"Other"}},a.initView=function(){a.configurationName="",a.subjectConfig=[],a.descriptionConfig=[],a.fieldConfig=[],a.variables=f},a.getConfiguration=function(){return i.get({accountId:c.id,id:c.configurationId}).$promise.then(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,e.socket.on("salesforce_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 k.get().$promise.then(function(b){a.customVariables=b.rows})["catch"](function(a){g.error(a)})},a.getFields=function(){return h.fields({id:c.id}).$promise.then(function(c){a.accountFields=_.sortByOrder(b("salesforce")(c),"name","asc"),console.log(a.accountFields)})["catch"](function(a){g.error(a)})},a.addItem=function(b){var d={};switch(b){case"subject":case"description":d={type:"string",content:""};break;case"field":d={content:""}}return i.save({accountId:c.id,id:c.configurationId,controller:b},d).$promise.then(function(c){switch(b){case"subject":a.subjectConfig.push(c);break;case"description":a.descriptionConfig.push(c);break;case"field":a.fieldConfig.push(c)}})["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 j.update({accountId:c.id,configurationId:c.configurationId,id:a.id},a).$promise.then(function(){})["catch"](function(a){g.error(a)})},a.removeItem=function(a){return j["delete"]({accountId:c.id,configurationId:c.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.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);if(c)switch(c.type){case"picklist":return c.picklistValues;default:return}}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view.configurations.view",{url:"/view/:configurationId",templateUrl:"app/salesforce/view/configuration/view/view.html",controller:"SalesforceViewConfigurationViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","$filter","SalesforceAccount",function(a,b,c,d,e,f,g,h,i,j,k){a.initView=function(){return k.get({id:c.id}).$promise.then(function(b){a.account=b})["catch"](function(a){h.error(a)})},a.updateItem=function(){return k.update({id:c.id},a.account).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){h.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view",{url:"/view/:id",templateUrl:"app/salesforce/view/view.html",controller:"SalesforceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.salesforce.view.account",{url:"/account",templateUrl:"app/salesforce/view/view.account.html"})}]),angular.module("xCallyShuttleApp").controller("SalesforceWizardCtrl",["$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.item.serverUrl=c.protocol()+"://"+location.host},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/salesforce/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/salesforce/list")}).error(function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.wizard",{url:"/wizard",templateUrl:"app/salesforce/wizard/wizard.html",controller:"SalesforceWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization",{url:"/customization",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("CustomizationGeneralViewCtrl",["$scope","gridOptions","$uibModal","FileUploader","$cookieStore","xAlert","$translate","Setting","$rootScope",function(a,b,c,d,e,f,g,h,i){a.radioSwitch={isActive:i.license.custom?!0:!1,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"};var j=a.uploader=new d({url:"api/settings/logo/main",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});j.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),j.onSuccessItem=function(a,b){i.settings.logo=b.logo,f.show(g.instant("MESSAGE_WELL_DONE"),"success")},j.onErrorItem=function(){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},j.onCompleteAll=function(){j.clearQueue()};var k=a.uploader2=new d({url:"api/settings/logo/login",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});k.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),k.onSuccessItem=function(a,b){f.show(g.instant("MESSAGE_WELL_DONE"),"success")},k.onErrorItem=function(){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},k.onCompleteAll=function(){k.clearQueue()},a.initView=function(){return h.get({id:1}).$promise.then(function(b){a.settings={defaultLogo:b.defaultLogo,defaultLoginLogo:b.defaultLoginLogo,footerWhiteLabel:b.footerWhiteLabel,defaultFooterWhiteLabel:b.defaultFooterWhiteLabel}})["catch"](function(a){f.error(a)})},a.update=function(){return h.update({id:1},a.settings).$promise.then(function(b){_.merge(i.settings,a.settings),f.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization.view.general",{url:"/general",templateUrl:"app/setting/customization/view/general/general.html",controller:"CustomizationGeneralViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("CustomizationViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization.view",{url:"/view",templateUrl:"app/setting/customization/view/view.html",controller:"CustomizationViewCtrl",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"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general",{url:"/general",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("GeneralMainViewCtrl",["$scope","xAlert","$translate","Setting",function(a,b,c,d){a.initView=function(){return d.get({id:1}).$promise.then(function(b){a.settings={agi_port:b.agi_port,min_internal:b.min_internal,min_mailbox:b.min_mailbox,securePassword:b.securePassword}})["catch"](function(a){b.error(a)})},a.update=function(){return d.update({id:1},a.settings).$promise.then(function(a){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general.view.main",{url:"/main",templateUrl:"app/setting/general/view/main/main.html",controller:"GeneralMainViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("GeneralViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general.view",{url:"/view",templateUrl:"app/setting/general/view/view.html",controller:"GeneralViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("License",["$resource",function(a){return a("/api/licenses/:id/:controller",{id:"@id"},{request:{method:"POST",params:{id:"request"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license",{url:"/license",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("LicenseUpdateCtrl",["$scope","$translate","$uibModalInstance","xAlert","Setting",function(a,b,c,d,e){a.form={},a.item={},a.getLicense=function(){return e.get({id:1}).$promise.then(function(b){a.item.license=b.license})["catch"](function(a){d.error(a)})},a.update=function(){return e.update({id:1},a.item).$promise.then(function(a){d.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){d.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("LicenseViewCtrl",["$scope","$rootScope","$translate","License","xAlert","$window","$uibModal",function(a,b,c,d,e,f,g){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.initView=function(){return d.get(function(b){a.item=b.license})},a.submitRequest=function(){return d.request(a.item,function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")},function(a){switch(a.status){case 304:e.show(a.statusText,"info");break;default:e.error(a)}})},a.updateLicense=function(){var a=g.open({animation:!0,templateUrl:"app/setting/license/view/update.modal.html",controller:"LicenseUpdateCtrl"});a.result.then(function(){f.location.reload()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license.view",{url:"/view",templateUrl:"app/setting/license/view/view.html",controller:"LicenseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/pricing-tables.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Externip",["$resource",function(a){return a("/api/network/externips/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Localnet",["$resource",function(a){return a("/api/network/localnets/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network",{url:"/network",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ExternipCtrl",["$scope","$uibModal","gridOptions","Externip",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"network_externip.csv",columnDefs:[{name:"value"},{name:"action",buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(d,b,a)},a.createItem=function(c){var d=b.open({animation:!0,templateUrl:"app/setting/network/view/externip/externip.create.modal.html",controller:"ExternipCreateCtrl",resolve:{item:c}});d.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ExternipCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","Externip","xAlert","item",function(a,b,c,d,e,f,g){a.initModal=function(){a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_EXTERNIP"):b.instant("APPLICATION_NEW_EXTERNIP")},a.save=function(){return g?e.update({id:a.item.id},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)}):e.save({},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view.externip",{url:"/externip",templateUrl:"app/setting/network/view/externip/externip.html",controller:"ExternipCtrl"})}]),angular.module("xCallyShuttleApp").controller("LocalnetCtrl",["$scope","gridOptions","Localnet","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"network_localnet.csv",columnDefs:[{name:"value"},{name:"action",buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)},a.createItem=function(b){var c=d.open({animation:!0,templateUrl:"app/setting/network/view/localnet/localnet.create.modal.html",controller:"LocalnetCreateCtrl",resolve:{item:b}});c.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("LocalnetCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","Localnet","xAlert","item",function(a,b,c,d,e,f,g){a.initModal=function(){if(a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_LOCALNET"):b.instant("APPLICATION_NEW_LOCALNET"),g&&g.value){var c=a.item.value.split("/");c.length>1&&(a.item.address=c[0],a.item.mask=c[1])}},a.save=function(){var d=a.item.address+"/"+a.item.mask;return g?e.update({id:a.item.id},{value:d}).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)}):e.save({},{value:d}).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view.localnet",{url:"/localnet",templateUrl:"app/setting/network/view/localnet/localnet.html",controller:"LocalnetCtrl"})}]),angular.module("xCallyShuttleApp").controller("NetworkViewCtrl",function(){}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view",{url:"/view",templateUrl:"app/setting/network/view/view.html",controller:"NetworkViewCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting",{url:"/setting",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:18}}})}]),angular.module("xCallyShuttleApp").factory("Setting",["$resource",function(a){return a("/api/settings/:id/:controller/:param",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Smtp",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller/:controller2",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp",{url:"/smtp",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SmtpViewCtrl",["$scope","$stateParams","$translate","socket","MailServerOut","Setting","MailAccount","xAlert",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.smtpDisabled=!1,a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.CONST_TIMEOUT=3e4,a.item={account:{service:!0,MailServerOut:{ssl:!1}}},f.get({id:"smtp"}).$promise.then(function(b){a.item.account=b,d.socket.on("mail_server_out:state",function(b){Number(b.id)===a.item.account.MailServerOut.id&&(a.item.account.MailServerOut.state=b.state,a.item.account.MailServerOut.source=JSON.parse(b.source))})})["catch"](function(b){switch(console.log(b),b.status){case 404:a.item.account.name=null,a.item.account.address=null,a.item.account.MailServerOut={ssl:!1},h.show("Service SMTP server not configured.","info");break;default:h.error(b)}})},a.updateItem=function(){return a.item.account.id?(delete a.item.account.MailServerOut.state,delete a.item.account.MailServerOut.source,f.update({id:"smtp",controller:a.item.account.id},a.item.account).$promise.then(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})):f.save({id:"smtp"},{description:"Custom Account",name:a.item.account.name,address:a.item.account.address,service:a.item.account.service,custom:!0,MailServerOut:a.item.account.MailServerOut}).$promise.then(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})},a.test=function(){return e.get({id:a.item.account.MailServerOut.id,controller:"test"}).$promise["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp.view",{url:"/view",templateUrl:"app/setting/smtp/view/view.html",controller:"SmtpViewCtrl",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"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system",{url:"/system",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SystemViewConsoleCtrl",["$scope","Setting","xAlert","usSpinnerService","$timeout","$translate",function(a,b,c,d,e,f){function g(b){var c=_.findIndex(a.commandHistory.commands,function(a){return a===b});-1!==c&&a.commandHistory.commands.splice(c,1),a.commandHistory.commands.unshift(b)}a.output="<b>"+f.instant("APPLICATION_CONSOLE_WELCOME")+"</b><br/>",a.item={command:""},a.commandHistory={commands:[],index:-1},a.busy=!1,a.cmdFocus=function(){e(function(){angular.element("#command").trigger("focus")})},a.sendCmd=function(){return a.commandHistory.index=-1,a.tmp=a.item.command,a.item.command="",a.output+="<b>motion*CLI> "+a.tmp+"</b><br>",a.tmp?(g(a.tmp.trim()),a.busy=!0,d.spin("console-spinner"),b.save({controller:"asterisk"},{command:a.tmp}).$promise.then(function(b){a.output+=b.content.replace(/(?:\r\n|\r|\n)/g,"<br />").replace("Response: Follows<br />Privilege: Command<br />","").replace(/ActionID: .[0-9]*<br \/>/,"").replace(/ActionID: .[0-9]*/,"")+"<br>",d.stop("console-spinner"),a.busy=!1,a.cmdFocus()})["catch"](function(b){d.stop("console-spinner"),a.output+="command error:"+b.data.message+"<br>",a.busy=!1,a.cmdFocus()})):void 0},a.keyUp=function(b){switch(b.keyCode){case 40:a.commandHistory.commands[a.commandHistory.index-1]?a.item.command=a.commandHistory.commands[--a.commandHistory.index]:(a.item.command="",a.commandHistory.index=-1);break;case 38:a.commandHistory.commands[a.commandHistory.index+1]&&(a.item.command=a.commandHistory.commands[++a.commandHistory.index]);break;case 37:break;case 39:break;default:a.commandHistory.index=-1}},e(function(){angular.element("#command").trigger("focus"),d.stop("console-spinner")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.console",{url:"/console",templateUrl:"app/setting/system/view/console/console.html",controller:"SystemViewConsoleCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewGeneralCtrl",["$scope","$stateParams","$translate","socket","Setting","xAlert","usSpinnerService",function(a,b,c,d,e,f,g){function h(b){a.system.memory={labels:_.keys(b.memory.details),values:_.values(_.map(b.memory.details,function(a){return Math.round(a/1024)})),Total:Math.round(b.memory.Total/1024)},g.stop("memory-spinner"),a.system.disks=[],_.forEach(b.disks,function(b){a.system.disks.push({mount:b.mount,size:Number((b.size/1048576).toFixed(2)),values:_.values(_.map(b.details,function(a){return Number((a/1048576).toFixed(2))})),labels:_.keys(b.details)})}),a.system.mount=a.system.disks[0],g.stop("disk-spinner"),a.system.cpu={motion:Math.round(b.cpu.motion),cores:[]},_.forEach(b.cpu.cores,function(b){delete b.nice,delete b.irq,a.system.cpu.cores.push({labels:_.keys(b),values:_.values(b),colours:["#803690","#DCDCDC","#00ADF9"]})}),g.stop("cpu-spinner")}a.system={mount:void 0},a.initView=function(){return g.spin("memory-spinner"),g.spin("disk-spinner"),g.spin("cpu-spinner"),e.get({controller:"system"}).$promise.then(function(a){h(a)})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.general",{url:"/general",templateUrl:"app/setting/system/view/general/general.html",controller:"SystemViewGeneralCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewLogsCtrl",["$scope","$stateParams","$translate","socket","Setting","xAlert","usSpinnerService",function(a,b,c,d,e,f,g){a.initView=function(){return a.logs={errors:"",output:""},g.spin("logs-spinner"),e.get({controller:"logs"}).$promise.then(function(b){a.logs=b,g.stop("logs-spinner")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.logs",{url:"/logs",templateUrl:"app/setting/system/view/logs/logs.html",controller:"SystemViewLogsCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view",{url:"/view",templateUrl:"app/setting/system/view/view.html",controller:"SystemViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","gridOptions","$uibModal","$location","Update",function(a,b,c,d,e){a.initCounter=function(){a.$on("timer-stopped",function(a,b){console.log("Timer Stopped - data = ",b),d.path("/dashboard/voice")})},a.initView=function(){var c={exporterCsvFilename:"updates.csv",enableFiltering:!1,enableSorting:!1,enablePaginationControls:!1,enableSelectAll:!1,columnDefs:[{name:"message"},{width:125,name:"version",cellClass:"text-center ui-grid-vcenter"},{width:125,name:"createdAt",displayName:"APPLICATION_UPDATED_AT",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'}]};a.gridOptions=b.gridOptions(e,c,a)},a.pull=function(){c.open({animation:!0,templateUrl:"app/setting/update/list/list.pull.html",controller:"UpdateListPullCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates.list",{url:"/list",templateUrl:"app/setting/update/list/list.html",controller:"UpdateListCtrl"}).state("main.setting.updates.landing",{url:"/landing",templateUrl:"app/setting/update/list/landing.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListPullCtrl",["$scope","$uibModalInstance","$translate","$location","Update",function(a,b,c,d,e){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){return e.pull().$promise["finally"](function(){b.dismiss("close"),d.path("/setting/updates/landing")})}},{classes:"btn default",text:"Cancel",click:function(){b.dismiss("cancel")}}]}}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["hasUpdate"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCtrl",["$scope","$uibModal","$translate","SquareOdbc","gridOptions","xAlert",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"odbc.csv",columnDefs:[{name:"name"},{name:"dsn",displayName:"APPLICATION_ODBC"},{name:"description"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/square/odbc/view/{{row.entity.id}}/settings",name:"settings"},{"class":"green-jungle",name:"check",onClick:"grid.appScope.checkConnection(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(d,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/odbc/list/list.create.modal.html",controller:"SquareOdbcListCreateCtrl"});c.result.then(function(){a.gridOptions.getPage()})},a.checkConnection=function(a){return d.get({id:a,controller:"check"}).$promise.then(function(){f.show(c.instant("MESSAGE_CONNECTION_VERIFIED"),"success")})["catch"](function(){f.show(c.instant("MESSAGE_CONNECTION_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareOdbc","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.item.dsn||(a.item.dsn="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion"),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.square.odbc.list",{url:"/list",templateUrl:"app/square/odbc/list/list.html",controller:"SquareOdbcListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc",{url:"/odbc",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareOdbc",["$resource",function(a){return a("/api/square/odbc/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcViewCtrl",["$scope","$translate","$stateParams","SquareOdbc","xAlert",function(a,b,c,d,e){a.odbc={},a.getOdbc=function(){return d.get({id:c.id}).$promise.then(function(b){a.odbc=b})["catch"](function(a){e.error(a)})},a.updateOdbc=function(){var f=angular.copy(a.odbc);return d.update({id:c.id},f).$promise.then(function(){e.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.view",{url:"/view/:id",templateUrl:"app/square/odbc/view/view.html",controller:"SquareOdbcViewCtrl",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.square.odbc.view.settings",{url:"/settings",templateUrl:"app/square/odbc/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCtrl",["$scope","$uibModal","SquareProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"projects.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/square/projects/view/{{row.entity.id}}",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/square/project/list/list.create.modal.html",controller:"SquareProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareProject","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.square.projects.list",{url:"/list",templateUrl:"app/square/project/list/list.html",controller:"SquareProjectListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareProject",["$resource",function(a){return a("/api/square/projects/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareProjectViewCtrl",["$scope","$stateParams","Auth","xAlert","SquareProject","socket","$translate","$log","$uibModal",function(a,b,c,d,e,f,g,h,i){a.squareProject={},a.$on("$destroy",function(){f.unsyncUpdates("square_project")}),a.getProject=function(){return e.get({id:b.id}).$promise.then(function(b){a.squareProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!==a&&-1!==a.indexOf("Script error."));else{var e=new Image;e.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(f){d.error(f)}},b.token=c.getToken();var a=new EditorUi(new Editor);a.openString(b.preproduction,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),f.socket.on("square_project:save",function(c){c.id===b.id&&(a.squareProject=_.merge(a.squareProject,c))})})["catch"](function(a){d.error(a)})},a.editNotes=function(){var c=i.open({animation:!0,templateUrl:"app/square/project/view/projectNotes.modal.html",controller:["$scope","$uibModalInstance","notes",function(a,b,c){a.notes=c,a.close=function(){b.close(a.notes)},a.cancel=function(){b.dismiss("cancel")}}],resolve:{notes:{value:a.squareProject.notes}}});c.result.then(function(a){return e.update({id:b.id},{notes:a.value}).$promise.then(function(){d.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.error(a)})},function(){h.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.view",{url:"/view/:id",templateUrl:"app/square/project/view/view.html",controller:"SquareProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/square/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/square/js/Editor.js","assets/plugins/square/js/Graph.js","assets/plugins/square/js/EditorUi.js","assets/plugins/square/js/Actions.js","assets/plugins/square/js/Menus.js","assets/plugins/square/js/Sidebar.js","assets/plugins/square/js/Toolbar.js","assets/plugins/square/js/Dialogs.js"]
-}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:14}}})}]),angular.module("xCallyShuttleApp").factory("ReportSquare",["$resource",function(a){return a("/api/report/square/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ReportSquareDetail",["$resource",function(a){return a("/api/report/square/details/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareRealtimeViewGeneralCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","ReportSquare","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j){function k(b){return h.spin("spinner-grid"),g.get(m).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=b.rows})["catch"](function(a){f.error(a)})["finally"](function(){b&&l(),h.stop("spinner-grid")})}function l(){e.socket.on("report_square:save",function(b){if(b.leaveAt){var c=_.remove(a.gridOptions.data,{id:b.id});c&&k()}else{var d=_.find(a.gridOptions.data,{id:b.id});if(!d&&a.gridOptions.data.length<m.limit){var e=_.clone(m);if(_.forEach(["offset","limit","controller","order"],function(a){delete e[a]}),_.isEmpty(e))a.gridOptions.data.push(b);else{var f=!0;_.forOwn(e,function(a,c){_.includes(b[c],a)||(f=!1)}),f&&a.gridOptions.data.push(b)}}}})}var m={controller:"realtime",offset:0,limit:25};a.moment=moment,a.init=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:25,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"uniqueid"},{name:"callerid"},{name:"extension"},{name:"project_name",displayName:"APPLICATION_PROJECT",headerCellFilter:"translate"},{name:"joinAt",displayName:"APPLICATION_ELAPSED_TIME",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><timer start-time="grid.appScope.moment(row.entity.joinAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1}],data:[],gridMenuTitleFilter:function(a){var b=i.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){n(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?m.order=null:m.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),k()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){m.offset=(a-1)*b,m.limit=b,k()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?m[a.name]=a.filters[0].term:delete m[a.name]}),k()})}},k(!0)};var n=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("report_square")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime.view.general",{url:"/general",templateUrl:"app/square/realtime/view/general/general.html",controller:"SquareRealtimeViewGeneralCtrl"})}]),angular.module("xCallyShuttleApp").controller("SquareRealtimeViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime.view",{url:"/view",templateUrl:"app/square/realtime/view/view.html",controller:"SquareRealtimeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("SquareRecordingListCtrl",["$scope","SquareRecording","gridOptions",function(a,b,c){a.SquareRecording=b;a.initView=function(){var d={exporterCsvFilename:"recordings.csv",rowHeight:30,columnDefs:[{name:"uniqueid"},{name:"callerid",displayName:"APPLICATION_CALLERIDNUM"},{name:"filename"},{name:"extension"},{name:"projectName",displayName:"APPLICATION_PROJECT"},{name:"audio",displayName:"",width:100,enableSorting:!1,enableFiltering:!1,cellClass:"ui-grid-vcenter",cellTemplate:"<div><audio-file-download data-ng-if=\"row.entity.savePath.split('.').pop() == 'wav'\" params=\"{id:row.entity.id,controller:'stream'}\" resource=\"grid.appScope.SquareRecording\"></audio-file-download><span data-ng-if=\"row.entity.value.split('.').pop() == 'gsm'\" title=\"{{'MESSAGE_GSM_PREVIEW_NOT_SUPPORTED' | translate}}\">{{'MESSAGE_GSM_PREVIEW_NOT_SUPPORTED' | translate}}</span></div>"},{name:"action",width:80,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.filename || row.entity.uniqueid, row.entity.id)"},{directive:'<motion-file-download params="{id:row.entity.id,controller:\'stream\'}" resource="grid.appScope.SquareRecording" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="(row.entity.filename || row.entity.uniqueid)+\'.wav\'"></motion-file-download>'}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.recordings.list",{url:"/list",templateUrl:"app/square/recording/list/list.html",controller:"SquareRecordingListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.recordings",{url:"/recordings",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareRecording",["$resource",function(a){return a("/api/square/recordings/:id/:controller",{id:"@id"},{update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square",{url:"/square",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:14}}})}]),angular.module("xCallyShuttleApp").factory("Agent",["$resource",function(a){return a("/api/agents/:id/:controller/:controller1/:controller2/:controller3",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents",{url:"/agents",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}})}]),angular.module("xCallyShuttleApp").controller("AgentListCtrl",["$scope","$timeout","Agent","Auth","gridOptions",function(a,b,c,d,e){a.initView=function(){a.Auth=d;var b={exporterCsvFilename:"agents.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/staff/agents/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-meadow",href:"/staff/agents/view/{{row.entity.id}}/queues/voice",name:"queues"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(c,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.list",{url:"/list",templateUrl:"app/staff/agent/list/list.html",controller:"AgentListCtrl",data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}})}]),angular.module("xCallyShuttleApp").controller("AgentViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","Agent","FileUploader","Auth","MailQueue","User","VoiceQueue","ChatQueue","FaxQueue","SmsQueue","OpenChannelQueue","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){a.Auth=i,a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},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.initVoiceQueues=function(){var a={},b={};return l.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{name:a.name}}),g.get({id:e.id,controller:"voice",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"voice",e.id,g)})["catch"](function(a){console.error(a)})},a.initChatQueues=function(){var a={},b={};return m.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"chat",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"chat",e.id,g)})["catch"](function(a){console.error(a)})},a.initMailQueues=function(){var a={},b={};return j.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"mail",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"mail",e.id,g)})["catch"](function(a){console.error(a)})},a.initSmsQueues=function(){var a={},b={};return o.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"sms",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"sms",e.id,g)})["catch"](function(a){console.error(a)})},a.initFaxQueues=function(){var a={},b={};return n.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"fax",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"fax",e.id,g)})["catch"](function(a){console.error(a)})},a.initOpenchannelQueues=function(){var a={},b={};return p.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"openchannel",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"openchannel",e.id,g)})["catch"](function(a){console.error(a)})},a.updatePassword=function(){var b={newPassword:a.agent.newPwd};return i.isAdmin()?b.id=e.id:b.oldPassword=a.agent.currentPwd,k.changePassword(b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})};var r=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});r.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),r.onSuccessItem=function(b,e){a.agent.userpic=e.userpic,a.agent.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},r.onErrorItem=function(){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},r.onCompleteAll=function(){r.clearQueue()},a.initView=function(){return g.get({id:e.id}).$promise.then(function(b){return a.agent=b,a.agent.transport=a.agent.transport?a.agent.transport.split(","):[],a.agent.allow=a.agent.allow?a.agent.allow.split(";"):[],a.agent.nat=a.agent.nat?a.agent.nat.split(","):[],q.get({id:1}).$promise}).then(function(b){a.setting=b})["catch"](function(a){c.error(a)})},a.patchItem=function(){return g.update({id:e.id},{chatCapacity:a.agent.chatCapacity,mailCapacity:a.agent.mailCapacity,faxCapacity:a.agent.faxCapacity,smsCapacity:a.agent.smsCapacity,openchannelCapacity:a.agent.openchannelCapacity}).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})},a.updateItem=function(){var b=angular.copy(a.agent);return delete b.password,delete b.md5secret,b.transport=b.transport.join(","),b.allow=b.allow.join(";"),b.nat=b.nat.join(","),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.staff.agents.view",{url:"/view/:id",templateUrl:"app/staff/agent/view/view.html",controller:"AgentViewCtrl",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"]}])}]},data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.account",{url:"/account",templateUrl:"app/staff/agent/view/view.account.html",data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}},resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}}).state("main.staff.agents.view.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.voice.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.chat.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.mail.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.fax.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.sms",{url:"/sms",templateUrl:"app/staff/agent/view/view.sms.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.openchannel",{url:"/openchannel",templateUrl:"app/staff/agent/view/view.openchannel.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.motionbar",{url:"/motionbar",templateUrl:"app/staff/agent/view/view.motionbar.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.queues",{url:"/queues",templateUrl:"app/staff/agent/view/view.queues.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}},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.agents.view.queues.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.queues.voice.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:7}}}).state("main.staff.agents.view.queues.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.queues.chat.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:8}}}).state("main.staff.agents.view.queues.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.queues.mail.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:9}}}).state("main.staff.agents.view.queues.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.queues.fax.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:10}}}).state("main.staff.agents.view.queues.sms",{url:"/sms",templateUrl:"app/staff/agent/view/view.queues.sms.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:11}}}).state("main.staff.agents.view.queues.openchannel",{url:"/openchannel",templateUrl:"app/staff/agent/view/view.queues.openchannel.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:20}}})}]),angular.module("xCallyShuttleApp").controller("AgentWizardCtrl",["$scope","$rootScope","$location","$translate","$http","Agent","VoiceQueue","ChatQueue","MailQueue","SmsQueue","FaxQueue","OpenChannelQueue","Setting","xAlert","WizardHandler",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a.maxAmount=1e3,a._data={voice:{queues:[]},chat:{queues:[]},mail:{queues:[]},sms:{queues:[]},fax:{queues:[]},openchannel:{queues:[]}},a._agent=angular.copy(a._data),a.initVoiceQueues=function(){return g.get().$promise.then(function(b){a._data.voice.queues=_.map(b.rows,function(a){return{name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.voice,a._agent.voice,"voice",null,null)})["catch"](function(a){console.error(a)})},a.initChatQueues=function(){return h.get().$promise.then(function(b){a._data.chat.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.chat,a._agent.chat,"chat",null,null)})["catch"](function(a){console.error(a)})},a.initMailQueues=function(){return i.get().$promise.then(function(b){a._data.mail.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.mail,a._agent.mail,"mail",null,null)})["catch"](function(a){console.error(a)})},a.initSmsQueues=function(){return j.get().$promise.then(function(b){a._data.sms.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.sms,a._agent.sms,"sms",null,null)})["catch"](function(a){console.error(a)})},a.initFaxQueues=function(){return k.get().$promise.then(function(b){a._data.fax.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.fax,a._agent.fax,"fax",null,null)})["catch"](function(a){console.error(a)})},a.initOpenchannelQueues=function(){return l.get().$promise.then(function(b){a._data.openchannel.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.openchannel,a._agent.openchannel,"openchannel",null,null)})["catch"](function(a){console.error(a)})},a.forms={info:void 0,voice:void 0},a.item={role:"agent",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){o.wizard().next()},a.getAmount=function(){return m.get({controller:"internal",internal:a.item.minInternal}).$promise.then(function(b){a.item.minInternal=Number(b.value),a.maxAmount=b.range||1e3})["catch"](function(a){n.error(a)})},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return m.get({controller:"internal"}).$promise.then(function(b){return a.internal=b,a.item.internal=b.value,a.item.minInternal=b.value,a.maxAmount=b.range||1e3,m.get({id:1}).$promise}).then(function(b){a.setting=b})["catch"](function(a){n.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return delete b.minInternal,b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),b.channels=a._agent,f.save(b).$promise.then(function(){c.path("/staff/agents/list")})["catch"](function(a){console.log(a),n.error(a)})},a.createItems=function(){var b=angular.copy(a.item);return delete b.internal,b.transport&&(b.transport=b.transport.join(",")),b.allow&&(b.allow=b.allow.join(";")),f.save({id:"bulk"},b).$promise.then(function(){c.path("/staff/agents/list")})["catch"](function(a){console.log(a),n.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.wizard",{url:"/wizard",templateUrl:"app/staff/agent/wizard/wizard.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}},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.agents.bulk",{url:"/bulk",templateUrl:"app/staff/agent/wizard/wizard-bulk.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff",{url:"/staff",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TeamCreateCtrl",["$scope","$uibModalInstance","Team","xAlert",function(a,b,c,d){a.form={},a.item={},a.ok=function(){return c.save(a.item).$promise.then(function(){b.close(a.item)})["catch"](function(a){d.error(a)})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("TeamListCtrl",["$scope","Team","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"teams.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:100,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/staff/teams/view/{{row.entity.id}}/settings",name:"profile"},{"class":"{{row.entity.defaultEntry ? 'green-turquoise disabled' : 'green-turquoise'}}",name:"agents",href:"/staff/teams/view/{{row.entity.id}}/agents"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){d.open({animation:!0,templateUrl:"app/staff/team/list/create.modal.html",controller:"TeamCreateCtrl"}).result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.list",{url:"/list",templateUrl:"app/staff/team/list/list.html",controller:"TeamListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Team",["$resource",function(a){return a("/api/teams/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams",{url:"/teams",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("TeamViewCtrl",["$scope","$http","$stateParams","$translate","Team","Agent","xAlert",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return console.log("agents",b),e.save({id:a.team.id,controller:"agents"},{agents:b})},deselect:function(b){return e["delete"]({id:a.team.id,controller:"agents",agents:b})}}};a.initView=function(){return e.get({id:c.id}).$promise.then(function(b){a.team=b})["catch"](function(a){g.error(a)})},a.initAgents=function(){return f.get().$promise.then(function(b){return a.agents=b.rows,e.get({id:c.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindTeam(_.map(b.rows,"id"),_.map(a.agents,function(a){return{id:a.id,name:a.name,fullname:a.fullname,internal:a.internal}}),h)})["catch"](function(a){g.error(a)})},a.updateItem=function(){var b=angular.copy(a.team);return e.update({id:c.id},b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.view",{url:"/view/:id",templateUrl:"app/staff/team/view/view.html",controller:"TeamViewCtrl",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.teams.view.agents",{url:"/agents",templateUrl:"app/staff/team/view/view.agents.html",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.teams.view.settings",{url:"/settings",templateUrl:"app/staff/team/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TelephoneListCtrl",["$scope","Telephone","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"fullname"},{name:"name"},{name:"internal"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/staff/telephones/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.list",{url:"/list",templateUrl:"app/staff/telephone/list/list.html",controller:"TelephoneListCtrl",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").factory("Telephone",["$resource",function(a){return a("/api/telephones/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones",{url:"/telephones",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneViewCtrl",["$scope","$http","$stateParams","$translate","$cookieStore","Auth","xAlert","Telephone",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.Auth=f,a.forms={},h.get({id:c.id}).$promise.then(function(b){delete b.password,a.item=b,a.item.transport=a.item.transport?a.item.transport.split(","):[],a.item.allow=a.item.allow?a.item.allow.split(";"):[]})["catch"](function(a){g.error(a)})},a.updateItem=function(){var b=angular.copy(a.item);return b.transport=b.transport.join(","),b.allow=b.allow.join(";"),h.update(b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})},a.updatePassword=function(){return h.update({password:a.item.password}).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.view",{url:"/view/:id",templateUrl:"app/staff/telephone/view/view.html",controller:"TelephoneViewCtrl",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.telephones.view.account",{url:"/account",templateUrl:"app/staff/telephone/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.telephones.view.voice",{url:"/voice",templateUrl:"app/staff/telephone/view/view.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate","Telephone","Setting",function(a,b,c,d,e,f,g,h){a.forms={},a.item={allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return h.get({controller:"internal"}).$promise.then(function(b){a.item.internal=b.value})["catch"](function(a){e.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),g.save(b).$promise.then(function(){c.path("/staff/telephones/list")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.wizard",{url:"/wizard",templateUrl:"app/staff/telephone/wizard/wizard.html",controller:"TelephoneWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","$timeout","User","Auth","gridOptions",function(a,b,c,d,e){function f(a){if(a){var b=_.words(a),c=_.map(b,function(a){return a?a[0]:""});return c.join("").toUpperCase()}return!1}a.getUserAvatar=function(a,c,d){b(function(){angular.element("#userImg"+a).avatar({useGravatar:!1,initials:d?[]:f(c),fallbackImage:"api/users/avatar/"+d,size:80})})},a.isAdmin=function(a){return"admin"===a},a.initView=function(){var b={exporterCsvFilename:"users.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/staff/users/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-meadow",href:"/staff/users/view/{{row.entity.id}}/permit/voice",name:"permits",hide:"grid.appScope.isAdmin(row.entity.role)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(c,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.list",{url:"/list",templateUrl:"app/staff/user/list/list.html",controller:"UserListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Module",["$resource",function(a){return a("/api/modules/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("User",["$resource",function(a){return a("/api/users/:id/:controller/:controller2/:controller3",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},me:{method:"GET",params:{id:"me"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users",{url:"/users",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$stateParams","$cookieStore","$translate","FileUploader","User","Auth","xAlert","MailQueue","VoiceQueue","ChatQueue","FaxQueue","SmsQueue","OpenChannelQueue","Team","Module","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c=_.find(a.modules,{id:b.ModuleId});if(b.status===!0)c.status=!0;else{var d=_.filter(c.SubModules,{status:!0});d.length||(c.status=!1)}c.ModuleId&&r(c)}function s(a,b){a.forEach(function(a){a.status=b,a.SubModules&&a.SubModules.length&&s(a.SubModules,b)})}function t(a,b){b.forEach(function(b){_.find(a,{id:b.id})?b.status=!0:b.status=!1,b.SubModules&&b.SubModules.length&&t(a,b.SubModules)})}function u(a,b){return a=_.union(a,_.map(_.filter(b,{status:!0}),"id")),b.forEach(function(b){b.SubModules&&b.SubModules.length&&(a=_.union(a,u(a,b.SubModules)))}),a}a.Auth=g,a._=_,a.moduleSwitch={onText:"On",offText:"Off",isActive:!0,size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.initVoiceQueues=function(){var a={},c={};return j.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){
-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'),
+a.state("main.jscripty.projects.list",{url:"/list",templateUrl:"app/jscripty/project/list/list.html",controller:"JscriptyProjectListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectReportCtrl",["$scope","uiGridConstants","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope","gridOptions","JscriptyProject","$location",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a.projectStats={started:0,incomplete:0,completed:0},a.projectId=e.id,a.initView=function(){m.get({id:e.id}).$promise.then(function(b){a.project=b})["catch"](function(a){i.error(a)}),m.get({id:e.id,controller:"sessions"}).$promise.then(function(b){var c=_.groupBy(b.rows,"status");a.projectStats.started=c.started?c.started.length:0,a.projectStats.completed=c.completed?c.completed.length:0,a.projectStats.incomplete=c.incomplete?c.incomplete.length:0})["catch"](function(a){i.error(a)})},a.pdf=function(a,b){var c=[];if(a){var d=html2canvas(document.getElementById(a)),e=d.parse(),f=d.render(e),g=f.toDataURL("image/png");c.push({image:g,width:500,style:"img"})}b.length&&_.forEach(b,function(a){var b=html2canvas(document.getElementById(a.question_id)),d=b.parse(),e=b.render(d),f=e.toDataURL("image/png");c.push({image:f,width:500,style:"img"})});var h={content:c};pdfMake.createPdf(h).download("Project_summary.pdf")},a.getProjectSessions=function(){var c={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"queue",displayName:"APPLICATION_QUEUE"},{name:"membername",displayName:"APPLICATION_AGENT"},{name:"calleridnum",displayName:"APPLICATION_CALLERIDNUM"},{name:"createdAt",displayName:"APPLICATION_STARTEDAT",filterHeaderTemplate:'<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',filters:[{name:"From",condition:b.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:b.filter.LESS_THAN_OR_EQUAL}]},{name:"completedAt",displayName:"APPLICATION_COMPLETEDAT",filterHeaderTemplate:'<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',filters:[{name:"From",condition:b.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:b.filter.LESS_THAN_OR_EQUAL}]},{name:"status",displayName:"APPLICATION_STATUS"},{name:"last_question_id",displayName:"APPLICATION_LASTQUESTIONID"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/{{row.entity.projectId}}/session/{{row.entity.session_id}}",name:"Detail"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteSession(row.entity.session_id)"}]}]};a.gridOptions=l.gridOptions(m,c,a,{id:e.id,controller:"sessions"})},a.deleteSession=function(b){m["delete"]({id:e.id,controller:"sessions",action:b}).$promise.then(function(b){a.gridOptions.getPage(),a.initView(),i.show(j.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){i.error(a)})},a.getSessionDetails=function(){m.get({id:e.id,controller:"sessions",action:e.sessionId}).$promise.then(function(b){a.session=b,a.sessionQuestions=b.ReportJscriptyQuestions})["catch"](function(a){i.error(a)})},a.getQuestionSummary=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"question_id",displayName:"APPLICATION_QUESTIONID"},{name:"question_type",displayName:"APPLICATION_QUESTIONTYPE"},{name:"question_label",displayName:"APPLICATION_QUESTIONLABEL"},{name:"question_text",displayName:"APPLICATION_QUESTION"},{name:"count",displayName:"APPLICATION_COUNT",enableFiltering:!1},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/jscripty/projects/report/"+e.id+"/detail/{{row.entity.question_id}}",name:"Detail"}]}]};a.gridOptions=l.gridOptions(m,b,a,{id:e.id,controller:"questions",action:"summary"})},a.getQuestionInputs=function(){var b={exporterCsvFilename:"jscriptyProjects.csv",columnDefs:[{name:"session_id",displayName:"APPLICATION_SESSIONID"},{name:"question_id",displayName:"APPLICATION_QUESTIONID",enableFiltering:!1},{name:"question_label",displayName:"APPLICATION_QUESTIONLABEL",enableFiltering:!1},{name:"question_text",displayName:"APPLICATION_QUESTION",enableFiltering:!1},{name:"input_label",displayName:"APPLICATION_INPUTLABEL",enableFiltering:!1},{name:"input_value",cellTemplate:'<div uib-tooltip="{{row.entity.input_value}}">{{row.entity.input_value}}</div>',displayName:"APPLICATION_INPUTVALUE",enableFiltering:!1}]};a.gridOptions=l.gridOptions(m,b,a,{id:e.id,controller:"inputs"})},a.getProjectDetail=function(){a.projectDetail=[],m.query({id:e.id,controller:"questions",action:"detail"}).$promise.then(function(b){console.log(e.questionId),e.questionId?a.projectDetail.push(_.find(b,function(a){return a.question_id==parseInt(e.questionId)})):a.projectDetail=b,console.log(a.projectDetail)})["catch"](function(a){i.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.report",{url:"/report/:id",templateUrl:"app/jscripty/project/report/report.html",controller:"JscriptyProjectReportCtrl"}).state("main.jscripty.projects.report.sessions",{url:"/sessions",templateUrl:"app/jscripty/project/report/report.sessions.html"}).state("main.jscripty.projects.report.summary",{url:"/summary",templateUrl:"app/jscripty/project/report/report.summary.html"}).state("main.jscripty.projects.report.inputs",{url:"/inputs",templateUrl:"app/jscripty/project/report/report.inputs.html"}).state("main.jscripty.projects.report.detail",{url:"/detail",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.questionDetail",{url:"/detail/:questionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.detail.html"}).state("main.jscripty.projects.report.sessionDetail",{url:"/session/:sessionId",controller:"JscriptyProjectReportCtrl",templateUrl:"app/jscripty/project/report/report.session.detail.html"})}]),angular.module("xCallyShuttleApp").controller("JscriptyProjectViewCtrl",["$scope","$http","$state","$stateParams","socket","Auth","Modal","xAlert","$translate","$rootScope",function(a,b,c,d,e,f,g,h,i,j){a.jscriptyProject={},a.getProject=function(){b.get("/api/jscripty/projects/"+d.id).success(function(b){a.jscriptyProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!=a&&-1!=a.indexOf("Script error."));else{var d=new Image;d.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(e){}},b.token=f.getToken();var a=new EditorUi(new Editor);a.openString(b.draft,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),e.syncUpdates("jscripty_project",[b],function(a,c,d){c.id===b.id})})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.jscripty.projects.view",{url:"/view/:id",templateUrl:"app/jscripty/project/view/view.html",controller:"JscriptyProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/jscripty/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/jscripty/js/Editor.js","assets/plugins/jscripty/js/Graph.js","assets/plugins/jscripty/js/EditorUi.js","assets/plugins/jscripty/js/Actions.js","assets/plugins/jscripty/js/Menus.js","assets/plugins/jscripty/js/Sidebar.js","assets/plugins/jscripty/js/Toolbar.js","assets/plugins/jscripty/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LandingCtrl",["$scope","$location","$window","$timeout","Auth","Setting",function(a,b,c,d,e,f){a.initLanding=function(){a.year=moment().year(),f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)});var c,g,h;return(h=e.getCurrentUser().$promise)?h.then(function(e){switch(g=e,g.role){case"user":for(var f=0;f<g.Modules.length&&!(c=g.Modules[f].path);f++);break;case"admin":case"agent":c="/dashboard/voice"}c||(a.message="MESSAGE_NO_AVAILABLE_MODULES"),d(function(){b.path(c)},500)})["catch"](function(a){console.error(a),b.path("/login")}):void b.path("/login")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("landing",{url:"/landing",templateUrl:"app/landing/landing.html",controller:"LandingCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css","assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("LoginCtrl",["$scope","Auth","$location","$window","$rootScope","Setting","xAlert","$stateParams",function(a,b,c,d,e,f,g,h){a.year=moment().year(),a.recovered=h.reset,a.userLogin={},a.userSignUp={},a.loginSubmitted=!1,a.signupSubmitted=!1,a.errorLogin=!1,a.errorSignup=!1,a.errorLog="",a.forgotPassword=!1,a.showRecoverMessage=!1,a.flagLogin1=!1,a.getInfo=function(){return f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},a.toggleLogin=function(){a.flagLogin1=!a.flagLogin1},a.toggleForgotPassword=function(b){a.showRecoverMessage=!1,a.userLogin.email="",a.forgotPassword=b},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.recover=function(){b.recover({email:a.userLogin.email}).then(function(){a.showRecoverMessage=!0})["catch"](function(b){console.log(b),a.showRecoverMessage=!1,g.error(b)})},a.login=function(d){a.loginSubmitted=!0,d.$valid?b.login({name:a.userLogin.name,password:a.userLogin.password,remember:a.userLogin.remember}).then(function(){c.path("/landing")})["catch"](function(b){a.errorLog=b.message||"error",a.errorLogin=!0}):a.errorLogin=!0},a.signup=function(c){a.signupSubmitted=!0,c.$valid?b.createUser({email:a.userSignUp.email,fullname:a.userSignUp.fullname,name:a.userSignUp.name,password:a.userSignUp.password,role:a.userSignUp.role,online:!0})["catch"](function(b){a.errorLog=b.message||"error",a.errorSignup=!0}):a.errorSignup=!0},a.loginOauth=function(a){d.location.href="/auth/"+a}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("login",{url:"/login",templateUrl:"app/login/login.html",params:{reset:null},controller:"LoginCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Action",["$resource",function(a){return a("/api/actions/:name/:controller",{name:"@name"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Ami",["$resource",function(a){return a("/api/ami/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("ChooseContactModalCtrl",["$scope","$uibModalInstance","data","xAlert","$translate","Contact",function(a,b,c,d,e,f){function g(){return f.get({id:c.eventId,controller:"checkevent"}).$promise.then(function(b){a.contacts=b.rows})["catch"](function(a){d.error(a)})}function h(){return delete c.type,f.get(c).$promise.then(function(b){a.contacts=b.rows})["catch"](function(a){d.error(a)})}a.open=function(a){b.close(a)},a.getContacts=function(){switch(c.type){case"event":g();break;case"detail":h();break;default:b.dismiss("cancel")}},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalCtrl",["$scope","$uibModalInstance",function(a,b){a.close=function(){b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("CloseEditedTabModalJscriptyCtrl",["$scope","$uibModalInstance","project","JscriptyProject","xAlert",function(a,b,c,d,e){a.init=function(){a.project=c},a.close=function(){d.update({id:a.project.projectId,controller:"sessions",action:a.project.sessionId},{status:"incomplete",completedAt:Date(),last_question_id:a.project.lastQuestionId}).$promise.then(function(a){e.show("Project Ended","success")}),b.close()},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("ContactManagerSetDisposition",["$scope","$uibModalInstance","VoiceDisposition",function(a,b,c){a.initDisposition=function(){return c.get().$promise.then(function(b){a.dispositions=b.rows})["catch"](function(a){console.error(a)})},a.item={},a.ok=function(){b.close(a.item)},a.cancel=function(){b.dismiss()}}]),angular.module("xCallyShuttleApp").controller("customGridDateFilterModalCtrl",["$scope","$rootScope","$log","$uibModalInstance","term","hasTime",function(a,b,c,d,e,f){if(a.hasTime=f,a.dateTime={},e)if(f){var g=e.split(" ");a.dateTime.filterDate=moment(g[0]),a.dateTime.time=e[1]?moment(g[1],"HH:mm"):moment()}else a.dateTime.filterDate=moment(e);else f&&(a.dateTime.time=moment());a.setFilterDate=function(b){d.close({date:moment(b).format("YYYY-MM-DD").toString(),time:f?a.dateTime.time?moment(a.dateTime.time).format("HH:mm").toString():moment().format("HH:mm").toString():null})},a.cancelDateFilter=function(){d.dismiss()}}]),angular.module("xCallyShuttleApp").controller("customGridTagsModalCtrl",["$scope","$rootScope","$log","$uibModalInstance","term","Tag","xAlert",function(a,b,c,d,e,f,g){a.initModal=function(){return a.item={},f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name"),a.item.myTags=e})["catch"](function(a){console.log("error retrieving tags"),g.error(a),d.dismiss()})},a.setFilterTags=function(){d.close(a.item.myTags)},a.cancelTagsFilter=function(){d.dismiss()}}]),angular.module("xCallyShuttleApp").factory("templateVariable",["$translate",function(a){return[{id:"voice",label:a.instant("APPLICATION_VOICE"),title:a.instant("APPLICATION_VOICE"),groups:[{label:a.instant("APPLICATION_QUEUE"),values:[{value:"{{uniqueid}}",label:a.instant("APPLICATION_UNIQUEID"),description:a.instant("APPLICATION_UNIQUEID")},{value:"{{calleridnum}}",label:a.instant("APPLICATION_CALLERIDNUM"),description:a.instant("APPLICATION_CALLERIDNUM")},{value:"{{calleridname}}",label:a.instant("APPLICATION_CALLERIDNAME"),description:a.instant("APPLICATION_CALLERIDNAME")},{value:"{{queue}}",label:a.instant("APPLICATION_QUEUE"),description:a.instant("APPLICATION_QUEUE")},{value:"{{interface}}",label:a.instant("APPLICATION_INTERFACE"),description:a.instant("APPLICATION_INTERFACE")},{value:"{{membername}}",label:a.instant("APPLICATION_MEMBERNAME"),description:a.instant("APPLICATION_MEMBERNAME")},{value:"{{holdtime}}",label:a.instant("APPLICATION_HOLDTIME"),description:a.instant("APPLICATION_HOLDTIME")},{value:"{{talktime}}",label:a.instant("APPLICATION_TALKTIME"),description:a.instant("APPLICATION_TALKTIME")},{value:"{{connectedlinenum}}",label:a.instant("APPLICATION_CONNECTEDLINENUM"),description:a.instant("APPLICATION_CONNECTEDLINENUM")},{value:"{{connectedlinename}}",label:a.instant("APPLICATION_CONNECTEDLINENAME"),description:a.instant("APPLICATION_CONNECTEDLINENAME")},{value:"{{agentconnectAt}}",label:a.instant("APPLICATION_CONNECTED_AT"),description:a.instant("APPLICATION_CONNECTED_AT")},{value:"{{agentcalledAt}}",label:a.instant("APPLICATION_CALLED_AT"),description:a.instant("APPLICATION_CALLED_AT")},{value:"{{agentcompleteAt}}",label:a.instant("APPLICATION_COMPLETED_AT"),description:a.instant("APPLICATION_AGENT_CALLED_AT")},{value:"{{reason}}",label:a.instant("APPLICATION_REASON"),description:a.instant("APPLICATION_REASON")},{value:"{{lastevent}}",label:a.instant("APPLICATION_LAST_EVENT"),description:a.instant("APPLICATION_LAST_EVENT")},{value:"{{channel}}",label:a.instant("APPLICATION_CHANNEL"),description:a.instant("APPLICATION_CHANNEL")}]}]},{id:"chat",label:a.instant("APPLICATION_CHAT"),title:a.instant("APPLICATION_CHAT"),groups:[{label:a.instant("APPLICATION_VARIABLES"),values:[{value:"{{username}}",label:a.instant("APPLICATION_USERNAME"),description:a.instant("APPLICATION_USERNAME")},{value:"{{email}}",label:a.instant("APPLICATION_MAIL"),description:a.instant("APPLICATION_MAIL")},{value:"{{text}}",label:a.instant("APPLICATION_TEXT"),description:a.instant("APPLICATION_TEXT")},{value:"{{chatWebsite}}",label:a.instant("APPLICATION_WEBSITE"),description:a.instant("APPLICATION_WEBSITE")}]}]},{id:"mail",label:a.instant("APPLICATION_MAIL"),title:a.instant("APPLICATION_MAIL"),groups:[{label:a.instant("APPLICATION_INTERACTION"),values:[{value:"{{interactionId}}",label:a.instant("APPLICATION_INTERACTION_ID"),description:a.instant("APPLICATION_INTERACTION_ID")},{value:"{{subject}}",label:a.instant("APPLICATION_SUBJECT"),description:a.instant("APPLICATION_SUBJECT")},{value:"{{{body}}}",label:a.instant("APPLICATION_MESSAGE"),description:a.instant("APPLICATION_MESSAGE")},{value:"{{accountName}}",label:a.instant("APPLICATION_ACCOUNT"),description:a.instant("APPLICATION_ACCOUNT")},{value:"{{from}}",label:"From",description:"From"},{value:"{{to}}",label:"To",description:"To"},{value:"{{cc}}",label:"Cc",description:"Cc"},{value:"{{agentName}}",label:a.instant("APPLICATION_AGENT_NAME"),description:a.instant("APPLICATION_AGENT_NAME")},{value:"{{agentEmail}}",label:a.instant("APPLICATION_AGENT_EMAIL"),description:a.instant("APPLICATION_AGENT_EMAIL")},{value:"{{createdAt}}",label:a.instant("APPLICATION_CREATED_AT"),description:a.instant("APPLICATION_CREATED_AT")}]}]}]}]),angular.module("xCallyShuttleApp").controller("gridDatePickerFilterCtrl",["$scope","$timeout","$uibModal","uiGridConstants",function(a,b,c,d){b(function(){a.col.colDef.name;a.openDatePicker=function(b){var d=c.open({templateUrl:"app/main/customDateFilter.modal.html",controller:"customGridDateFilterModalCtrl",size:"md",windowClass:"custom-date-filter-modal",resolve:{term:[function(){return b.term||null}],hasTime:b.hasTime||!1}});d.result.then(function(c){a.colFilter.listTerm=[],a.colFilter.term=c.date,b.hasTime&&(a.colFilter.term+=" "+c.time)})}})}]),angular.module("xCallyShuttleApp").factory("gridOptions",["Modal","xAlert","$translate","$interval","$q","usSpinnerService",function(a,b,c,d,e,f){return{gridOptions:function(d,g,h,i,j,k,l){function m(a,b){a.filter&&a.filter.term&&b&&(o[a.name]=a.filter.term),a.filters&&(a.filters.length>1?a.filters.forEach(function(b){b.term?64===b.condition?o[a.name+"_uiFrom"]=b.term:256===b.condition&&(o[a.name+"_uiTo"]=b.term):64===b.condition?delete o[a.name+"_uiFrom"]:256===b.condition&&delete o[a.name+"_uiTo"]}):a.filters.length&&a.filters[0].term?o[a.name]=a.filters[0].term:delete o[a.name])}h.id=[];var n=k?"gridOptions"+k:"gridOptions",o={offset:0,limit:10},p={offset:0,limit:10};g.draggable&&(g.rowTemplate='<div grid="grid" class="ui-grid-draggable-row" draggable="true"><div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader, \'custom\': true }" ui-grid-cell></div></div>',g.useExternalPagination=!1,g.enablePaginationControls=!1,g.showGridFooter=!1);var q=function(a){var b=a&&a>h[n].paginationPageSize?h[n].paginationPageSize:a,c=b?30*b+120:177,d=angular.element(document.getElementsByName(n)).length?angular.element(document.getElementsByName(n)[0]):angular.element(document.getElementsByClassName("ui-grid")[0]);d.css("height",c+"px")},r=function(a,b){return h[n].enablePaginationControls||(delete o.offset,delete o.limit),f.spin("spinner-grid"),i=a||i,d=b||d,d.get(i?_.merge(o,i):o).$promise.then(function(a){h[n].totalItems=a.count,h[n].data=a.rows,q(a.rows.length),l&&l()})["catch"](function(a){console.error(a)})["finally"](function(){f.stop("spinner-grid")})};return h.deleteItem=a.confirm["delete"](function(a){var e=i?angular.copy(i):{};return _.merge(e,{id:a}),d.remove(e).$promise.then(function(){r(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.error(a)})}),h.deleteItems=a.confirm["delete"](function(){var a=i?angular.copy(i):{};return _.merge(a,{ids:h.id}),d["delete"](a).$promise.then(function(){r(),b.show(c.instant("MESSAGE_WELL_DONE")+"!","success"),h.gridApi.selection.clearSelectedRows(),h.id=[]})["catch"](function(a){b.error(a)})}),g.columnDefs.forEach(function(a){m(a,!0),a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){if(b.directive)a.cellTemplate+=b.directive;else{if(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="'+b.hide+'" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.uisref?' ui-sref="'+b.uisref+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",b.name)switch(b.name){case"delete":a.cellTemplate+='<i class="icon-trash"></i>';break;case"profile":case"settings":case"detail":case"embedding":a.cellTemplate+='<i class="icon-settings"></i>';break;case"view":a.cellTemplate+='<i class="icon-doc"></i>';break;case"clone":a.cellTemplate+='<i class="icon-docs"></i>';break;case"permits":a.cellTemplate+='<i class="icon-key"></i>';break;case"copy":a.cellTemplate+='<i class="fa fa-files-o"></i>';break;case"select":a.cellTemplate+='<i class="icon-check"></i>';break;case"preview":a.cellTemplate+='<i class="icon-magnifier"></i>';break;case"contacts":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"download":case"export":a.cellTemplate+='<i class="fa fa-download"></i>';break;case"agents":a.cellTemplate+='<i class="icon-people"></i>';break;case"run":a.cellTemplate+='<i class="fa fa-cogs"></i>';break;case"mailRoom":a.cellTemplate+='<i class="fa fa-envelope"></i>';break;case"chatRoom":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"faxRoom":a.cellTemplate+='<i class="icon-paper-plane"></i>';break;case"smsRoom":a.cellTemplate+='<i class="glyphicon glyphicon-comment"></i>';break;case"check":a.cellTemplate+='<i class="fa fa-check"></i>';break;case"queues":a.cellTemplate+='<i class="icon-docs"></i>';break;default:a.cellTemplate+="{{'APPLICATION_"+b.name.toUpperCase()+"' | translate}}"}else a.cellTemplate+=b.displayName?"{{'"+b.displayName+"' | translate}}":"";a.cellTemplate+="</a> "}}),a.cellTemplate+="<div>",delete a.buttons)}),_.merge({enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableRowSelection:!0,enableSelectAll:!0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,multiSelect:!0,getPage:r,gridMenuTitleFilter:function(a){var b=e.defer();return b.resolve(c.instant(a)),b.promise},exporterAllDataFn:function(){return p.offset=o.offset,p.limit=o.limit,o={offset:0,limit:null},r().then(function(){o.offset=p.offset,o.limit=p.limit,r()})},exporterFieldCallback:function(a,b,c,d){if("applications"===c.field&&b.entity.Applications){var e="";return _.forEach(b.entity.Applications,function(a){e+=a.app+"("+a.appdata.join(",")+")"}),e}return d},exporterHeaderFilter:c.instant,onRegisterApi:function(a){h.gridApi=a,h.gridApi.selection&&(h.gridApi.selection.on.rowSelectionChanged(h,function(a){a.isSelected?h.id.push(h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id):_.pull(h.id,h.gridApi.grid.options.primaryKey?a.entity[h.gridApi.grid.options.primaryKey]:a.entity.id)}),h.gridApi.selection.on.rowSelectionChangedBatch(h,function(a){a[0].isSelected?h.id=_.union(h.id,_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id")):_.map(a,h.gridApi.grid.options.primaryKey?"entity."+h.gridApi.grid.options.primaryKey:"entity.id").forEach(function(a){_.pull(h.id,a)})})),h.gridApi.core.on.sortChanged(h,function(a,b){0===b.length?o.order=null:o.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),r()});for(var e=0;e<h.gridOptions.columnDefs.length;e++)if(h.gridOptions.columnDefs[e].hasOwnProperty("sort")){o.order=h.gridOptions.columnDefs[e].name+" "+h.gridOptions.columnDefs[e].sort.direction.toUpperCase();break}h.gridApi.pagination.on.paginationChanged(h,function(a,b){o.offset=(a-1)*b,o.limit=b,r()}),h.gridApi.core.on.filterChanged(h,function(){var a=this.grid;a.columns.forEach(function(a){m(a)}),r()}),h.gridApi.draggableRows&&h.gridApi.draggableRows.on.rowDropped(h,function(a){a.fromIndex!==a.toIndex&&d.update(i,h[n].data).$promise.then(function(){b.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){b.error(a)})}),j||r()}},g)}}}]),angular.module("xCallyShuttleApp").controller("gridTagsFilterCtrl",["$scope","$timeout","$uibModal","uiGridConstants",function(a,b,c,d){b(function(){a.col.colDef.name;a.openTags=function(b){var d=c.open({templateUrl:"app/main/customTagsFilter.modal.html",controller:"customGridTagsModalCtrl",size:"md",resolve:{term:[function(){if(b.term){var a=b.term.split(";");return a.pop(),a}return[]}]}});d.result.then(function(b){a.colFilter.listTerm=[],b.length&&(a.colFilter.term=b.join(";")+";")})}})}]),angular.module("xCallyShuttleApp").controller("MainCtrl",["$scope","$rootScope","$translate","$timeout","socket","Auth","xAlert","$uibModal","$log","$state","Contact","$window","$location","localStorageService",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a.awesomeThings=[],b.workspaces=[],a.Auth=f,b.userModules={},f.getCurrentUser().$promise.then(function(a){a.Modules.forEach(function(a){b.userModules[a.id]=!0})})["catch"](function(a){g.error(a)}),b.initTours=function(){b.activeTour={main:!1},b.tourConfig={main:[{type:"function",fn:function(){b.tempTourPath=m.path()}},{type:"title",heading:c.instant("TOUR_MAIN_WELCOME"),text:'<div class="row"><div id="title-text" class="col-md-12"><span class="main-text">'+c.instant("TOUR_MAIN_DISCOVER_MOTION")+"</span><br/></div></div>",curtainClass:"myCurtainClass"},{type:"location_change",path:"/dashboard/voice"},{type:"title",heading:c.instant("TOUR_MAIN_DASHBOARD"),text:c.instant("TOUR_MAIN_DASHBOARD_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/tools/yourdashboards/show/1"},{type:"title",heading:c.instant("TOUR_MAIN_YOURDASHBOARD"),text:c.instant("TOUR_MAIN_YOURDASHBOARD_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/staff/agents/list"},{type:"title",heading:c.instant("TOUR_MAIN_AGENTS"),text:c.instant("TOUR_MAIN_AGENTS_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/channels/voice/queues/list"},{type:"title",heading:c.instant("TOUR_MAIN_VOICE_QUEUE"),text:c.instant("TOUR_MAIN_VOICE_QUEUE_ADD_MESSAGE"),curtainClass:"myCurtainClass"}]},b.license.chat&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/channels/chat/queues/list"},{type:"title",heading:c.instant("TOUR_MAIN_CHAT_QUEUE"),text:c.instant("TOUR_MAIN_CHAT_QUEUE_MESSAGE"),curtainClass:"myCurtainClass"}])),b.license.openchannel&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/channels/openchannel/accounts/list"},{type:"title",heading:c.instant("TOUR_MAIN_OPENCHANNEL"),text:c.instant("TOUR_MAIN_OPENCHANNEL_MESSAGE"),curtainClass:"myCurtainClass"}])),b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/square/projects/list"},{type:"title",heading:c.instant("TOUR_MAIN_SQUARE_PROJECT"),text:c.instant("TOUR_MAIN_SQUARE_PROJECT_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/tools/trunks/list"},{type:"title",heading:c.instant("TOUR_MAIN_TRUNKS"),text:c.instant("TOUR_MAIN_TRUNKS_MESSAGE"),curtainClass:"myCurtainClass"},{type:"location_change",path:"/tools/triggers/list"},{type:"title",heading:c.instant("TOUR_MAIN_TRIGGERS"),text:c.instant("TOUR_MAIN__MESSAGE"),curtainClass:"myCurtainClass"}]),b.license.jscripty&&(b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/jscripty/projects/list"},{type:"title",heading:c.instant("TOUR_MAIN_JSCRIPTY"),text:c.instant("TOUR_MAIN_JSCRIPTY_MESSAGE"),curtainClass:"myCurtainClass"}])),b.tourConfig.main=b.tourConfig.main.concat([{type:"location_change",path:"/analytics/reports/list"},{type:"title",heading:c.instant("TOUR_MAIN_REPORTS"),text:c.instant("TOUR_MAIN_REPORTS_MESSAGE"),curtainClass:"myCurtainClass"},{type:"title",heading:c.instant("TOUR_MAIN_END"),text:c.instant("TOUR_MAIN_END_MESSAGE"),curtainClass:"myCurtainClass"}])},b.onTourFinish=function(){n.set("skipTour",!0),b.tempTourPath&&m.path(b.tempTourPath)},b.onTourSkip=function(){n.set("skipTour",!0)},d(function(){n.get("skipTour")||(b.activeTour.main=!0)}),a.select=function(a){switch(a.type){case"chatRoom":case"mailRoom":case"faxRoom":a.unread=0}},e.socket.on("report_integration:tdDisposal",function(b){a.openTdTab(b)}),a.openTdTab=function(a){b.workspaces.push({type:"tdDisposal",name:"Motion Dialer Disposition","class":"icon-control-forward",active:!0,spooler:a})},a.deselect=function(){},a.isAdmin=f.isAdmin,a.isLoggedIn=f.isLoggedIn,a.getCurrentUser=f.getCurrentUser,a.CurrentUser=f.getCurrentUser(),e.socket.on("user_has_voice_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_chat_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_mail_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_fax_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),e.socket.on("user_has_sms_queue_permit:change",function(){a.CurrentUser=f.getCurrentUser()}),a.mainTab={active:!0},a.closeJscriptyTab=function(a){if(b.workspaces[a].edited){var c=h.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.jscripty.html",controller:"CloseEditedTabModalJscriptyCtrl",resolve:{project:b.workspaces[a]}});c.result.then(function(){b.workspaces.splice(a,1)})}else b.workspaces.splice(a,1)},b.closeTab=function(a){var c;b.workspaces[a].edited?"jscripty"===b.workspaces[a].type?b.workspaces[a].end():(c=h.open({animation:!0,templateUrl:"app/main/closeEditedTab.modal.html",controller:"CloseEditedTabModalCtrl"}),c.result.then(function(){b.workspaces.splice(a,1)},function(){i.info("Modal dismissed at: "+new Date)})):b.workspaces.splice(a,1)},a.createContact=function(d,e){return e.CompanyId||delete e.CompanyId,k.save(e).$promise.then(function(e){b.workspaces.splice(d,1);var f=e.firstName;e.lastName&&(f+=" "+e.lastName),a.openContactTab({firstName:e.firstName,lastName:e.lastName,id:e.id}),g.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){g.error(a)})};var o=function(b){var c=h.open({animation:!0,templateUrl:"app/main/chooseContact.modal.html",controller:"ChooseContactModalCtrl",resolve:{data:function(){return{type:"event",eventId:b.id}}}});c.result.then(function(c){c?a.openContactTab(c,b):a.newContact(b)},function(){i.info("Modal dismissed at: "+new Date)})};a.updateContact=function(a,d){var e=angular.copy(d);return e.CompanyId||(e.CompanyId=null),k.update({id:e.id},e).$promise.then(function(){b.workspaces[a].edited=!1,g.show(c.instant("MESSAGE_WELL_DONE")+"!","success")})["catch"](function(a){g.error(a)})},e.socket.on("report_integration:contactmanager",function(a){o(a)}),e.socket.on("report_integration:jscripty",function(b){a.openJscriptyTab({name:"Jscripty",id:b.projectId,calleridnum:b.calleridnum,calleridname:b.calleridname,queue:b.queue,
+membername:b.membername})}),e.socket.on("report_integration:salesforce",function(a){l.open(a.url,"_blank")}),b.openContactTab=function(a,c){var d=_.find(b.workspaces,{contactID:a.id});if(d)d.active=!0;else{var e=a.firstName;a.lastName&&(e+=" "+a.lastName),b.workspaces.push({name:e,type:"contact",contactID:a.id,"class":"icon-user",active:!0,data:c||null})}},a.openJscriptyTab=function(a){b.workspaces.push({name:a.name,type:"jscripty",active:!0,data:a})},a.newContact=function(a){b.workspaces.push({name:"New Contact",type:"newContact","class":"icon-user",active:!0,data:a||null})},a.$on("$viewContentLoaded",function(){Metronic.init()}),b.language=c.use(),a.changeLanguage=function(a){return c.use(a).then(function(a){b.language=a,-1!==["main.jscripty.projects.view","main.square.projects.view"].indexOf(j.current.name)&&l.location.reload()})["catch"](function(a){console.error(a)})},a.$on("$destroy",function(){console.log("main $destroy"),e.unsyncUpdates("user_has_voice_queue_permit"),e.unsyncUpdates("user_has_chat_queue_permit"),e.unsyncUpdates("user_has_mail_queue_permit"),e.unsyncUpdates("user_has_fax_queue_permit"),e.unsyncUpdates("user_has_sms_queue_permit")})}]),angular.module("xCallyShuttleApp").directive("ngSpinnerBar",["$rootScope",function(a){return{link:function(b,c){c.addClass("hide"),a.$on("$stateChangeStart",function(){"spinner-page"===c[0].id&&c.removeClass("hide")}),a.$on("$stateChangeSuccess",function(){"spinner-page"===c[0].id&&(c.addClass("hide"),$("body").removeClass("page-on-load"),Layout.setSidebarMenuActiveLink("match"),setTimeout(function(){Metronic.scrollTop()},1e3))}),a.$on("$spinnerStart",function(){"spinner-request"===c[0].id&&c.removeClass("hide")}),a.$on("$spinnerStop",function(){"spinner-request"===c[0].id&&c.addClass("hide")}),a.$on("$stateNotFound",function(){"spinner-page"===c[0].id&&c.addClass("hide")}),a.$on("$stateChangeError",function(){"spinner-page"===c[0].id&&c.addClass("hide")})}}}]).directive("a",function(){return{restrict:"E",link:function(a,b,c){(c.ngClick||""===c.href||"#"===c.href)&&b.on("click",function(a){a.preventDefault()})}}}).directive("nxEqual",function(){return{require:"ngModel",link:function(a,b,c,d){return c.nxEqual?(a.$watch(c.nxEqual,function(a){d.$setValidity("nxEqual",a===d.$viewValue)}),void d.$parsers.push(function(b){var e=b===a.$eval(c.nxEqual);return d.$setValidity("nxEqual",e),e?b:void 0})):void console.error("nxEqual expects a model as an argument!")}}}).directive("ngEnter",function(){return function(a,b,c){b.bind("keydown keypress",function(b){13===b.which&&(a.$apply(function(){a.$eval(c.ngEnter)}),b.preventDefault())})}}).directive("dropdownMenuHover",function(){return{link:function(a,b){b.dropdownHover()}}}).directive("uiSelectRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.uiSelectRequired=function(a){return a&&a.length}}}}).directive("rpattern",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){function e(a,b){return null==b||""===b||!h||a.test(b)?(d.$setValidity("pattern",!0),b):void d.$setValidity("pattern",!1)}var f,g=c.rpattern,h=!0;g&&(g.match(/^\/(.*)\/$/)?(g=new RegExp(g.substr(1,g.length-2)),f=function(a){return e(g,a)}):f=function(b){var c=a.$eval(g);if(!c||!c.test)throw new Error("Expected "+g+" to be a RegExp but was "+c);return e(c,b)}),d.$formatters.push(f),d.$parsers.push(f),c.$observe("required",function(a){h=a,f(d.$viewValue)})}}}).directive("newContact",["$compile","xAlert","socket","$translate","$timeout","List","Tag","Company","ReportCall","$uibModal","$rootScope","Auth",function(a,b,c,d,e,f,g,h,i,j,k,l){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,m){return function(a,m,n){function o(){a.$watch("contact",function(b,c){angular.equals(b,c)||(a.workspace.edited=!0)},!0)}a.license=k.license,a.Auth=l,a.forms={general:{}},a.firstLoad=!0,a.detail={tab:"main"},a.contact={CompanyId:"",disposed:!1},a.submitButtonLabel=d.instant("APPLICATION_CONFIRM"),a.getAgent=function(){return l.getCurrentUser().$promise.then(function(b){a.agent=b})["catch"](function(a){b.error(a)})},a.callPhoneBar=function(c,e){var f;switch(e){case"call":f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c;break;case"transfer":f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/transfer?number="+c;break;default:f="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c}return $http.get(f).success(function(){b.show(d.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){b.error(a)})},a.dispose=function(){return j.open({animation:!0,templateUrl:"app/main/cm.disposition.html",controller:"ContactManagerSetDisposition"}).result.then(function(c){return i.update({id:a.workspace.data.uniqueid},c).$promise.then(function(){a.contact.disposed=!0,b.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})})},a.init=function(){a.workspace.data&&(a.contact.firstName=a.workspace.data.calleridname?a.workspace.data.calleridname:a.workspace.data.messageId?a.workspace.data.messageId:a.workspace.data.uniqueid?a.workspace.data.uniqueid:"",a.workspace.data.calleridnum&&(a.contact.phone=a.workspace.data.calleridnum),a.workspace.data.from&&(a.contact.email=a.workspace.data.from)),a.getTags(),a.getCompanies(),a.getLists(),a.getAgent()},a.getLists=function(){return f.get().$promise.then(function(b){a.lists=b.rows,c.syncUpdates("list",a.lists),a.contact.ListId=a.lists[0]?a.lists[0].id:null,a.getCustomFields()})["catch"](function(a){b.error(a)})},a.getCustomFields=function(){return f.get({listId:a.contact.ListId,controller:"customfields"}).$promise.then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ListId===a.contact.ListId){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}}),!a.firstLoad||a.workspace.data?(a.workspace.edited=!0,a.firstLoad=!1):(a.firstLoad=!1,o())})["catch"](function(a){console.error(a),b.error(a)})},a.getTags=function(){return g.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.error(a)})},a.getCompanies=function(){return h.get().$promise.then(function(b){a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.error(a)})},e(function(){a.init()})}}}}]).directive("contact",["$compile","xAlert","socket","$timeout","List","Tag","Company","Contact","$translate","gridOptions","$uibModal","ReportCall","$rootScope","usSpinnerService","uiGridConstants","$log","Auth","$http",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.contactTab.html",compile:function(a,j){return function(a,j,s){function t(b){var c=[],d={};_.forEach(a.columns[a.log[b].show][a.log[b].detail].indexes,function(e,f){d={name:e,displayName:a.columns[a.log[b].show][a.log[b].detail].header[f],headerCellFilter:"translate",enableSorting:!1,enableColumnMenu:!1},"createdAt"===e&&(d.cellTemplate="<div class=\"centered-uigrid-td\">{{row.entity.createdAt | date:'dd/MM/yyyy HH:mm:ss'}}</div>",d.filterHeaderTemplate='<div class="ui-grid-filter-container row"><div ng-repeat="colFilter in col.filters" class="col-md-6 col-md-offset-0 col-sm-5 col-sm-offset-0 col-xs-5 col-xs-offset-0"><div custom-grid-date-filter-header></div></div></div>',d.filters=[{name:"From",condition:o.filter.GREATER_THAN_OR_EQUAL},{name:"To",condition:o.filter.LESS_THAN_OR_EQUAL}]),c.push(d)}),a.columns[a.log[b].show][a.log[b].detail].actions&&c.push(a.columns[a.log[b].show][a.log[b].detail].actions),c.forEach(function(a){u(a,b,!0),a.hasOwnProperty("displayName")||(a.displayName="APPLICATION_"+a.name.toUpperCase()),a.headerCellFilter="translate",a.hasOwnProperty("buttons")&&(a.displayName="",a.cellClass="ui-grid-vcenter",a.enableSorting=!1,a.enableFiltering=!1,a.enableColumnMenu=!1,a.cellTemplate="<div>",a.buttons.forEach(function(b){if(b.directive)a.cellTemplate+=b.directive;else{if(a.cellTemplate+="<a",a.cellTemplate+=b.hide?' data-ng-hide="'+b.hide+'" ':" ",a.cellTemplate+=b["class"]?' class="btn btn-xs '+b["class"]+'" ':" ",a.cellTemplate+=b.href?' data-ng-href="'+b.href+'" ':" ",a.cellTemplate+=b.uisref?' ui-sref="'+b.uisref+'" ':" ",a.cellTemplate+=b.onClick?' data-ng-click="'+b.onClick+'" ':" ",a.cellTemplate+=b.title?' title="'+b.title+'"':"",a.cellTemplate+=">",a.cellTemplate+=b.icon?'<i class="'+b.icon+'"></i>':"",b.name)switch(b.name){case"delete":a.cellTemplate+='<i class="fa fa-trash"></i>';break;case"profile":case"settings":case"detail":case"embedding":a.cellTemplate+='<i class="icon-settings"></i>';break;case"agents":a.cellTemplate+='<i class="icon-people"></i>';break;case"run":a.cellTemplate+='<i class="fa fa-cogs"></i>';break;case"mailRoom":a.cellTemplate+='<i class="fa fa-envelope"></i>';break;case"chatRoom":a.cellTemplate+='<i class="fa fa-users"></i>';break;case"faxRoom":a.cellTemplate+='<i class="icon-paper-plane"></i>';break;case"smsRoom":a.cellTemplate+='<i class="glyphicon glyphicon-comment"></i>';break;default:a.cellTemplate+="{{'APPLICATION_"+b.name.toUpperCase()+"' | translate}}"}else a.cellTemplate+=b.displayName?"{{'"+b.displayName+"' | translate}}":"";a.cellTemplate+="</a> "}}),a.cellTemplate+="<div>",delete a.buttons)});var e={enablePaginationControls:!0,exporterCsvFilename:b+".csv",columnDefs:c,enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:10,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,showTreeExpandNoChildren:!0,data:[],gridMenuTitleFilter:function(a){var b=$q.defer();return b.resolve(i.instant(a)),b.promise},onRegisterApi:function(c){a.gridApi=c,a.gridApi.grid.registerDataChangeCallback(function(){}),a.gridApi.core.on.sortChanged(a,function(a,c){0===c.length?v.order=null:v.order=c[0].name+" "+c[0].sort.direction.toUpperCase(),w(b)}),a.gridApi.pagination.on.paginationChanged(a,function(a,c){v.offset=(a-1)*c,v.limit=c,w(b)}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){u(a,b)}),w(b)})}};w(b,e)}function u(a,b,c){a.filter&&a.filter.term&&c&&(v[b][a.name]=a.filter.term),a.filters&&(a.filters.length>1?a.filters.forEach(function(c){c.term?64===c.condition?v[b][a.name+"_uiFrom"]=c.term:256===c.condition&&(v[b][a.name+"_uiTo"]=c.term):64===c.condition?delete v[b][a.name+"_uiFrom"]:256===c.condition&&delete v[b][a.name+"_uiTo"]}):a.filters.length&&a.filters[0].term?v[b][a.name]=a.filters[0].term:delete v[b][a.name])}a.moment=moment,a.license=m.license,a.forms={general:{}},a.detail={tab:"main"},a.log={daily:{show:"phone",type:"inbound",detail:"general"},history:{show:"phone",type:"inbound",detail:"general"}},a.columns={phone:{general:{header:["APPLICATION_SOURCE","APPLICATION_DESTINATION","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["source","destination","disposition","createdAt"]},queue:{header:["APPLICATION_CALLERID","APPLICATION_QUEUE","APPLICATION_DATE"],indexes:["calleridnum","queue","createdAt"]}},email:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["from","account","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"mailRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'mailRoom')"}]}}},chat:{general:{header:["APPLICATION_WEBSITE","APPLICATION_VISITOR","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["website","contact","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"chatRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'chatRoom')"}]}}},fax:{general:{header:["APPLICATION_FROM","APPLICATION_TO","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["contact","account","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"faxRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'faxRoom')"}]}}},sms:{general:{header:["APPLICATION_FROM","APPLICATION_DISPOSITION","APPLICATION_DATE"],indexes:["contact","disposition","createdAt"],actions:{name:"action",displayName:"",width:40,buttons:[{"class":"green",name:"smsRoom",onClick:"grid.appScope.openRoom(row.entity.id, 'smsRoom')"}]}}}},a.Auth=q,a.getAgent=function(){return q.getCurrentUser().$promise.then(function(b){a.agent=b})["catch"](function(a){b.error(a)})},a.callPhoneBar=function(c,d){var e;switch(d){case"call":e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c;break;case"transfer":e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/transfer?number="+c;break;default:e="http://127.0.0.1:"+a.agent.phoneBarRemoteControlPort+"/api/originate/"+c}return r.get(e).success(function(){b.show(i.instant("MESSAGE_WELL_DONE"),"success")}).error(function(a){b.error(a)})},a.copy=function(a){var c=k.open({animation:!0,size:"small",templateUrl:"app/contactmanager/contact/list/copy.modal.html",controller:"ContactManagerListCopyModalCtrl"});c.result.then(function(c){return h.save({id:a,controller:"copy"},c).$promise.then(function(a){m.openContactTab({firstName:a.firstName,lastName:a.lastName,id:a.id})})["catch"](function(a){b.error(a)})},function(){p.info("Modal dismissed at: "+new Date)})},a.merge=function(c){var d=k.open({animation:!0,size:"lg",templateUrl:"app/main/mergeContact.choose.modal.html",controller:"ContactManagerMergeContactChoose",resolve:{listId:c.ListId}});d.result.then(function(d){var e=k.open({animation:!0,size:"lg",templateUrl:"app/main/mergeContact.merge.modal.html",controller:"ContactManagerMergeContactMerge",resolve:{contactId:d,mergeContact:c}});e.result.then(function(e){return e.oldContact=c.id,h.save({id:d,controller:"merge"},e).$promise.then(function(b){m.workspaces.splice(a.index,1),_.remove(m.workspaces,{contactID:b.id}),m.openContactTab({firstName:b.firstName,lastName:b.lastName,id:b.id})})["catch"](function(a){b.error(a)})},function(){p.info("Modal dismissed at: "+new Date)})},function(){p.info("Modal dismissed at: "+new Date)})},a.dispose=function(){return k.open({animation:!0,templateUrl:"app/main/cm.disposition.modal.html",controller:"ContactManagerSetDisposition"}).result.then(function(c){return l.update({id:a.workspace.data.uniqueid},c).$promise.then(function(){a.contact.disposed=!0,b.show(i.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})})},a.companyInfo=function(b){k.open({animation:!0,size:"lg",templateUrl:"app/main/company.info.modal.html",controller:["$scope","$uibModalInstance","company",function(a,b,c){a.company=c,a.close=function(){b.dismiss("cancel")}}],resolve:{company:_.find(a.companies,{id:b})}})},a.updateLog=function(b,c,d,e){c&&(a.log[b].show=c),d&&(a.log[b].detail=d),e&&(a.log[b].type=e),t(b)},a.openRoom=function(a,b,c){var d=_.find(m.workspaces,{id:a,type:b});if(d)d.active=!0;else{var e;switch(b){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"}m.workspaces.push({id:a,type:b,"class":e,active:!0,data:c})}};var v={daily:{offset:0,limit:10},history:{offset:0,limit:10}},w=function(b,c){return n.spin("spinner-grid"),h.get(_.merge(_.merge({id:a.workspace.contactID,controller:"log",logType:b,order:"createdAt DESC"},a.log[b]),v[b])).$promise.then(function(d){c&&(a["gridOptions"+b]=c),a["gridOptions"+b].totalItems=d.count,a["gridOptions"+b].data=d.rows,x("gridOptions"+b,d.rows.length)})["catch"](function(a){console.error(a)})["finally"](function(){n.stop("spinner-grid")})},x=function(a,b){var c=b?30*b+120:177;angular.element(document.getElementsByName(a)[0]).css("height",c+"px")};a.getContact=function(){return h.get({id:a.workspace.contactID}).$promise.then(function(b){a.contact=b,a.contact.CompanyId||(a.contact.CompanyId=""),a.getCustomFields(b.ListId),a.updateLog("daily"),a.updateLog("history")})["catch"](function(a){console.error(a),b.error(a)})},a.getTags=function(){return f.get().$promise.then(function(b){a.tags=_.map(b.rows,"name")})["catch"](function(a){console.error(a),b.error(a)})},a.getCompanies=function(){return g.get().$promise.then(function(b){a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),c.syncUpdates("company",a.companies)})["catch"](function(a){console.error(a),b.error(a)})},a.getCustomFields=function(d){return a.customFields=[],e.get({listId:d,controller:"customfields"}).$promise.then(function(b){b.rows.forEach(function(b){try{"select"===b.type&&(b.values=JSON.parse(b.values)),a.customFields.push(b)}catch(c){console.log("Cf not valid:",b.alias)}}),c.socket.on("custom_field:remove",function(b){_.remove(a.customFields,function(a){return b.id==a.id})}),c.socket.on("custom_field:save",function(b){if(b.ListId===d){var c=_.find(a.customFields,{id:b.id});c||("string"==typeof b.values&&(b.values=JSON.parse(b.values)),a.customFields.push(b))}})})["catch"](function(a){console.error(a),b.error(a)})},d(function(){a.getTags(),a.getCompanies(),a.getContact(),a.getAgent()})}}}}]).directive("jscripty",["$compile","xAlert","$http","socket","JscriptyProject",function(a,b,c,d,e){return{restrict:"E",scope:{workspace:"=",index:"=",submit:"&onSubmit"},templateUrl:"app/main/template/template.jscriptyTab.html",compile:function(a,d){return function(a,d,f){a.count=0,a.questions=[];var g,h=a.workspace.data.id;c.get("/api/jscripty/projects/"+h+"/download").success(function(b){b?c.post("/api/jscripty/projects/"+h+"/sessions",{projectId:h,status:"started",queue:a.workspace.data.queue,calleridnum:a.workspace.data.calleridnum,callername:a.workspace.data.callername,membername:a.workspace.data.membername}).success(function(c){g=c.session_id,a.workspace.edited=!0,a.workspace.sessionId=g,a.workspace.projectId=h;var d=mxUtils.parseXml(b),e=new mxCodec(d);a.decObj=e.decode(d.documentElement);var f=_.find(a.decObj.cells,function(a){return a.vertex&&"start"==a.value.nodeName});if("OFF"==f.getAttribute("state")){var j=_.find(f.edges,function(a){return a.source.id==f.id}).target;a.questions[a.count]=a.currentQuestion=i(j)}else a.questions[a.count]=a.currentQuestion=f;a.saveQuestions()}):(console.log("No project published!"),alert("No project published!"),a.submit({index:a.index}))}),a.next=function(b,c){switch(a.currentQuestion.answer&&a.currentQuestion.answer!=c&&(a.questions=_.take(a.questions,a.count+1)),a.currentQuestion.answer=c,b.value.nodeName){case"question":b=i(b)}a.questions[a.count]=a.currentQuestion,a.currentQuestion=b,a.count++,a.questions[a.count]=b,a.saveQuestions()};var i=function(a){var b=[];return a.options=[],_.forEach(a.edges,function(c,d){if(c.source.id==a.id&&c.value){var e=String(c.value).split(",");e.length>1?(_.forEach(e,function(b,d){var e=Object.create(c);e.setValue(b),a.edges.push(e),a.options.push(b)}),b.push(c)):a.options.push(e[0])}}),_.forEach(b,function(b){_.remove(a.edges,function(a){return a.value==b.value&&a.id==b.id})}),a};a.end=function(){a.saveQuestions(),a.workspace.lastQuestionId=a.questions[a.questions.length-1].id,"end"==a.questions[a.questions.length-1].value.nodeName&&(a.workspace.edited=!1,e.update({id:h,controller:"sessions",action:g},{status:"completed",completedAt:Date(),last_question_id:a.questions[a.questions.length-1].id}).$promise.then(function(a){b.show("Project Ended","success")})),a.submit({index:a.index})},a.workspace.end=a.end,a.back=function(){a.count--,a.currentQuestion=a.questions[a.count]},a.setCurrentQuestion=function(b){a.count=b,a.currentQuestion=a.questions[a.count]},a.saveQuestions=function(){for(var c=[],d=[],f=0;f<a.questions.length;f++){if(a.questions[f].children)for(var i=a.questions[f].children,j=0;j<i.length;j++)d[j]={input_id:i[j].id,input_type:i[j].getAttribute("type"),input_label:i[j].getAttribute("label"),input_value:"checkbox"!=i[j].getAttribute("type")||i[j].answer?i[j].answer:!1};c[f]={sessionId:g,projectId:h,question_id:a.questions[f].id,question_type:a.questions[f].value.nodeName,question_label:a.questions[f].getAttribute("label"),question_text:a.questions[f].getAttribute("question")||a.questions[f].getAttribute("text"),question_other_label:a.questions[f].getAttribute("other"),question_other_answer:a.questions[f].otheranswer,question_answer:a.questions[f].answer,question_options:a.questions[f].options?JSON.stringify({options:a.questions[f].options}):null,index:f,ReportJscriptyInputs:d},d=[]}e.save({id:h,controller:"sessions",action:g,action2:"questions"},c).$promise.then(function(a){})["catch"](function(a){b.error(a)})}}}}}]).directive("reportBuilder",["$compile",function(a){return{restrict:"E",scope:{group:"=",fields:"=",forms:"=",firstCall:"="},templateUrl:"app/main/template/template.reportBuilderView.html",compile:function(b,c){var d,e;return d=b.contents().remove(),function(b,c,f){b.operators=[{name:"AND"},{name:"OR"}],b.conditions=[{name:"="},{name:"!="},{name:"<"},{name:"<="},{name:">"},{name:">="},{name:"LIKE"},{name:"NOT LIKE"},{name:"IS NULL"},{name:"IS NOT NULL"},{name:"IS EMPTY"},{name:"IS NOT EMPTY"}],b.inputIsRequired=function(a){if(a.condition)switch(a.condition){case"IS NULL":case"IS NOT NULL":case"IS EMPTY":case"IS NOT EMPTY":a.required=!1;break;default:a.required=!0}},b.addCondition=function(){b.group.rules.push({condition:"=",field:"",value:""})},b.removeCondition=function(a){b.group.rules.splice(a,1)},b.addGroup=function(){b.group.rules.push({group:{operator:"AND",rules:[{condition:"=",field:"",value:""}]}})},b.randomName=function(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.removeGroup=function(){b.$parent.group&&b.$parent.group.rules.splice(b.$parent.$index,1)},e||(e=a(d)),c.append(e(b,function(a){return a}))}}}}]).directive("dynamicName",["$compile",function(a){return{restrict:"A",terminal:!0,priority:1e3,link:function(b,c,d){c.attr("name",b.$eval(d.dynamicName)),c.removeAttr("dynamic-name"),a(c)(b)}}}]).directive("onReadFile",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e=a(d.onReadFile);c.on("change",function(a){var c=new FileReader;c.onload=function(a){b.$apply(function(){e(b,{$fileContent:a.target.result})})},c.readAsText((a.srcElement||a.target).files[0])})}}}]).directive("motionFileDownload",["xAlert","$translate","$timeout","$location","FileSaver","$compile",function(a,b,c,d,e,f){return{restrict:"E",template:'<a uib-tooltip=\'{{tooltiptext}}\' class="{{btnclass || \'btn default btn-xs blue-hoki\'}}" href="" data-ng-click="download()" ><i class="icon-cloud-download"></i>{{btncontent || \'\'}}</a>',scope:{mimetype:"=",filename:"=",resource:"=",params:"=",btnclass:"@",btncontent:"@",tooltiptext:"@"},link:function(b,c,d){var f=c.children()[0];b.$on("download-start",function(){$(f).attr("disabled","disabled")}),b.$on("downloaded",function(a,c){var d=base64ToBlob(c,b.mimetype);e.saveAs(d,b.filename),$(f).attr("disabled",!1)}),b.download=function(){return b.$emit("download-start"),b.resource.get(b.params).$promise.then(function(a){b.$emit("downloaded",a.downloadString)})["catch"](function(b){a.error(b),$(f).attr("disabled",!1)})}}}}]).directive("audioFileDownload",["xAlert","$translate","$uibModal",function(a,b,c){return{restrict:"E",template:'<button type="button" class="btn default btn-xs blue-hoki" data-ng-click="download()"><i class="fa fa-play"></i> {{ \'APPLICATION_PREVIEW\' | translate}}</button>',scope:{resource:"=",params:"="},link:function(b,d,e){var f=d.children()[0];b.$on("download-start",function(a,c){b.tempHtml=$(f).html(),$(f).attr("disabled","disabled").html('<i class="icon-refresh"></i> Loading...')}),b.$on("downloaded",function(a,d){c.open({animation:!0,size:"small",templateUrl:"app/main/audioFileDownload.play.modal.html",controller:["$scope","$uibModalInstance","$sce","audio",function(a,b,c,d){a.audio=c.trustAsResourceUrl("data:audio/wav;base64,"+d.data),a.close=function(){b.dismiss("cancel")}}],resolve:{audio:function(){return{data:d}}}});$(f).html(b.tempHtml).attr("disabled",!1)}),b.$on("error",function(a,c){$(f).html(b.tempHtml).attr("disabled",!1)}),b.download=function(){return b.$emit("download-start"),b.resource.get(b.params).$promise.then(function(a){b.$emit("downloaded",a.downloadString)})["catch"](function(c){a.error(c),b.$emit("error")})}}}}]).directive("uiRequired",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.required=function(a,b){return!(b&&0===b.length&&"true"===c.uiRequired)},c.$observe("uiRequired",function(){d.$setValidity("required",!("true"===c.uiRequired&&d.$viewValue&&0===d.$viewValue.length))})}}}).directive("schrollBottom",function(){return{scope:{schrollBottom:"="},link:function(a,b){a.$watchCollection("schrollBottom",function(a){a&&$(b).scrollTop($(b)[0].scrollHeight)})}}}).directive("customGridDateFilterHeader",function(){return{templateUrl:"app/main/customDateFilterHeader.html",controller:"gridDatePickerFilterCtrl"}}).directive("customGridTagsFilterHeader",function(){return{templateUrl:"app/main/customTagsFilterHeader.html",controller:"gridTagsFilterCtrl"}}).directive("infiniteScroll",["$window",function(a){return{link:function(a,b,c){var d=parseInt(c.threshold)||0,e=b[0];b.bind("scroll",function(){a.$eval(c.canLoad)&&e.scrollTop+e.offsetHeight>=e.scrollHeight-d&&a.$apply(c.infiniteScroll)})}}}]).directive("tigerDialDisposal",["$compile","xAlert","socket","$translate","$timeout","$rootScope","MotionDialerSpooler","Agent",function(a,b,c,d,e,f,g,h){return{restrict:"E",scope:{workspace:"=",index:"="},templateUrl:"app/main/template/template.tigerDialDisposal.html",compile:function(a,c){return function(a,c,i){a.moment=moment,a.entitySpooler={},a.forms={td:{}},a.init=function(){return h.get().$promise.then(function(b){a.agents=[],b&&b.rows.forEach(function(b){a.agents.push("SIP/"+b.name)})})["catch"](function(a){b.error(a)})},a.save=function(){var c;switch(a.entitySpooler.retrieve){case"CLOSED":c=g.close({id:parseInt(a.workspace.ticketId.id)});break;case"OPEN":c=g.open({id:parseInt(a.workspace.ticketId.id)});break;case"BLACK_LIST":c=g.blacklist({id:parseInt(a.workspace.ticketId.id)});break;case"PLANNED":c=g.planning({id:parseInt(a.workspace.ticketId.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm")});break;case"PLANNED_PEER":c=g.planningpeer({id:parseInt(a.workspace.ticketId.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm"),peer:a.entitySpooler.planningpeer})}c?c.$promise.then(function(c){console.log(c),c.status>0?(b.show(d.instant("MESSAGE_WELL_DONE"),"success"),$uibModalInstance.close()):c.response.RMI.errors.forEach(function(c){c?(b.show(c.field+": "+c.error,"danger"),f.workspaces.splice(a.index,1)):b.show("Please, check your connection!","danger")})})["catch"](function(a){b.error(a)}):b.show("RETRIEVE NOT FOUND","danger")},e(function(){a.init()})}}}}]),angular.module("xCallyShuttleApp").filter("propsFilter",function(){return function(a,b){var c=[];return angular.isArray(a)?a.forEach(function(a){for(var d=!1,e=Object.keys(b),f=0;f<e.length;f++){var g=e[f],h=b[g].toLowerCase();if(-1!==a[g].toString().toLowerCase().indexOf(h)){d=!0;break}}d&&c.push(a)}):c=a,c}}).filter("capitalize",function(){return function(a){return a?a.replace(/([^\W_]+[^\s-]*) */g,function(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}):""}}).filter("salesforce",function(){var a=["CallDisposition","CallDurationInSeconds","CallObject","CallType","IsArchived","Priority","Status","Type"];return function(b){return _.remove(b,function(b){return b.custom===!1&&a.indexOf(b.name)<0}),b}}).filter("sugarcrm",function(){var a=["account_id","account_name","account_name1","assigned_user_name","assigned_user_id","case_number","created_by","created_by_name","date_entered","date_modified","deleted","description","id","modified_by_name","modified_user_id","name"];return function(b){return _.remove(b,function(b){return a.indexOf(b.name)>=0}),b}}).filter("freshdesk",function(){var a=["requester","subject","agent","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.ticket_field.name)>=0}),b}}).filter("zendesk",function(){var a=["subject","assignee","description"];return function(b){return _.remove(b,function(b){return a.indexOf(b.type)>=0}),b}}).filter("slice",function(){return function(a,b,c){return a?a.slice(b,c):void 0}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main",{"abstract":!0,templateUrl:"app/main/main.html",controller:"MainCtrl",resolve:{authorization:["$q","Auth","$state","$timeout","$location",function(a,b,c,d,e){return b.getToken()?a.when():(d(function(){e.path("/login")}),a.reject())}],deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.css","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/ckeditor/ckeditor.js","assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("xAlert",["$translate","Notification","$state",function(a,b,c){return{show:function(c,d){switch(d){case"success":b.success({message:c,title:'<i class="glyphicon glyphicon-ok"></i> <strong>'+a.instant("MESSAGE_SUCCESS")+"!</strong>",delay:5e3});break;case"info":b.info({message:c,title:'<i class="glyphicon glyphicon-info-sign"></i> <strong>'+a.instant("MESSAGE_INFO")+"!</strong>",delay:5e3});break;case"danger":b.error({message:c,title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4});break;case"warning":b.warning({message:c,title:'<i class="glyphicon glyphicon-warning-sign"></i> <strong>'+a.instant("MESSAGE_WARNING")+"!</strong>",delay:1e4});break;default:b.info(c)}},error:function(d){var e,f;d?d.status&&401===d.status?(e="Unauthorized!",f=!0):e=d.data?d.data.translatedMessage||d.data.message||"Generic Error":d.translatedMessage||d.message||"Generic Error":e="Generic Error",b.error({message:a.instant(e),title:'<i class="glyphicon glyphicon-exclamation-sign"></i> <strong>'+a.instant("MESSAGE_ERROR")+"!</strong>",delay:1e4}),f&&c.go("landing")}}}]).factory("stResource",["$q","$filter","$timeout","$rootScope","$http","$translate","xAlert",function(a,b,c,d,e,f,g){return{getPage:function(b){var c={page:Math.ceil(b.pagination.start/b.pagination.number),per_page:b.pagination.number};b.sort.predicate&&(c.sort_by=b.sort.predicate,c.sort_order=b.sort.reverse?"DESC":"ASC"),_.forIn(b.search.predicateObject,function(a,b){c[b]=a}),b.search.params&&(c.clientQuery={},_.forIn(b.search.params,function(a,b){c.clientQuery[b]=a})),d.$broadcast("$spinnerStart"),e.get(b.url,{params:c}).success(function(a){f.resolve(a),d.$broadcast("$spinnerStop")}).error(function(a){g.error(a),d.$broadcast("$spinnerStop")});var f=a.defer();return f.promise}}}]).factory("xNotification",["$translate","Notification","$rootScope",function(a,b,c){return{show:function(d,e,f,g,h,i){var j=c.$new(),k={message:e,title:d,templateUrl:"app/main/template/template.notification.html",delay:g,scope:j};switch(j.acceptBtn=a.instant("APPLICATION_ACCEPT"),j.rejectBtn=a.instant("APPLICATION_REJECT"),j.nAccept=h,j.nReject=i,f){case"chat":j["class"]="alert-info",j.icon="icon-bubble";break;case"mail":j["class"]="alert-success",j.icon="icon-envelope";break;case"fax":j["class"]="alert-warning",j.icon="icon-paper-plane";break;case"sms":j["class"]="alert-danger",j.icon="glyphicon glyphicon-comment";break;case"openchannel":j["class"]="alert-danger",j.icon="icon-globe";break;default:j["class"]="alert-info";
+}return new b(k)}}}]),angular.module("xCallyShuttleApp").controller("ContactManagerMergeContactChoose",["$scope","$translate","Contact","gridOptions","List","uiGridConstants","xAlert","$stateParams","Company","$uibModalInstance","listId",function(a,b,c,d,e,f,g,h,i,j,k){a.initView=function(){var b;return e.get().$promise.then(function(b){return a.lists=[],a.customFields=[],b.rows.forEach(function(b,c){_.forEach(b.CustomFields,function(b){a.customFields.push({name:b.name,alias:b.alias})}),a.lists.push({value:b.id,label:b.name})}),i.get().$promise}).then(function(b){a.companies=[],b.rows.forEach(function(b,c){a.companies.push({value:b.id,label:b.name})})}).then(function(){var e=[{"class":"blue-hoki",name:"select",onClick:"grid.appScope.choose(row.entity.id)"}];b={exporterCsvFilename:"Contacts.csv",columnDefs:[{name:"firstName"},{name:"lastName"},{name:"phone"},{name:"email"},{name:"ListId",displayName:"APPLICATION_LIST",field:"List.name",enableFiltering:!1},{name:"CompanyId",displayName:"APPLICATION_COMPANY",field:"Company.name",filter:{type:f.filter.SELECT,term:h.companyId||null,selectOptions:a.companies}}]},_.forEach(a.customFields,function(a){b.columnDefs.push({name:a.name,displayName:a.alias,visible:!1})}),b.columnDefs.push({name:"action",width:30,buttons:e}),a.gridOptions=d.gridOptions(c,b,a,{ListId:k})})["catch"](function(a){g.error(a)})},a.choose=function(a){j.close(a)},a.cancel=function(){j.dismiss()}}]),angular.module("xCallyShuttleApp").controller("ContactManagerMergeContactMerge",["$scope","$translate","Contact","xAlert","Company","$uibModalInstance","contactId","List","mergeContact","Tag",function(a,b,c,d,e,f,g,h,i,j){a.initView=function(){return e.get().$promise.then(function(b){return a.companies=b.rows,a.companies.unshift({id:"",name:"-- None --"}),j.get().$promise}).then(function(b){return a.tags=_.map(b.rows,"name"),c.get({id:g}).$promise}).then(function(b){a.fields={},a.contact={};var c=_.merge(_.keys(b),_.keys(i));return _.forEach(c,function(c){switch(c){case"tags":a.contact.tags=_.union(b.tags||[],i.tags||[]);break;case"$promise":case"$resolved":break;default:a.fields[c]=[],b[c]&&a.fields[c].push(b[c]),i[c]&&a.fields[c].push(i[c]),a.contact[c]=a.fields[c][0]||null}}),h.get({listId:b.ListId,controller:"customfields"}).$promise}).then(function(b){a.customFields=b.rows,a.customFields.forEach(function(a){a.values=JSON.parse(a.values)})})["catch"](function(a){d.error(a)})},a.merge=function(){a.contact.CompanyId||(a.contact.CompanyId=null),f.close(a.contact)},a.cancel=function(){f.dismiss()}}]),angular.module("xCallyShuttleApp").factory("Widget",["$resource",function(a){return a("/api/widgets/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("MarketCtrl",["$scope","$http","$translate","socket","xAlert","Modal","$timeout","Integration",function(a,b,c,d,e,f,g,h){function i(a,b){return Math.floor(Math.random()*(b-a+1))+a}a.initView=function(){return h.get().$promise.then(function(b){a.integrations=b.rows,a.groupedIntegration=_.chunk(a.integrations,4),d.syncUpdates("integration",a.integrations,function(){a.groupedIntegration=_.chunk(a.integrations,4)})})["catch"](function(a){e.error(a,"danger")})},a.isProgressing=!1,a.$on("$destroy",function(){d.unsyncUpdates("integration")}),a.installIntegration=function(b){return navigator.onLine?(a.status="Downloading",a.percentage=i(1,50),a.isProgressing=!0,b.downloading=!0,h.update({id:b.id},{active:!0}).$promise.then(function(){g(function(){a.percentage=i(51,99),a.status="Installing"},2500),g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",b.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)})["catch"](function(){b.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})):void e.show(c.instant("MESSAGE_NO_INTERNET_CONNECTION")+".","danger")},a.uninstallIntegration=function(b){return navigator.onLine?(a.status="Uninstalling",a.percentage=i(1,99),a.isProgressing=!0,b.downloading=!0,h.update({id:b.id},{active:!1}).$promise.then(function(){g(function(){a.percentage=100,a.isProgressing=!1,a.status="Completed!",b.downloading=!1,e.show(c.instant("MESSAGE_WELL_DONE")+".","success")},5e3)})["catch"](function(){b.downloading=!1,a.percentage=0,a.isProgressing=!1,e.show(c.instant("MESSAGE_SOMETHING_WENT_WRONG")+".","danger")})):void e.show(c.instant("MESSAGE_NO_INTERNET_CONNECTION")+".","danger")}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.market",{url:"/market",templateUrl:"app/market/market.html",controller:"MarketCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("MotionbarCtrl",["$scope","$stateParams","$cookieStore","$window","$location","Auth",function(a,b,c,d,e,f){console.log(b),b.token&&b.userId&&b.role&&b.redirectTo?(f.loginWithToken(b.token,b.userId,b.role),d.location.href=decodeURIComponent(b.redirectTo)):e.path("/login")}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("motionbar",{url:"/motionbar?redirectTo&token&userId&role",template:"<div ui-view></div>",controller:"MotionbarCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.blacklist",{url:"/blacklist",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerBlackListListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerBlackList","uiGridConstants",function(a,b,c,d,e,f,g){a.initView=function(){a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"phone"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.phone, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/blacklist/list/list.create.modal.html",controller:"MotionDialerBlackListListCreateCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerBlackListListCreateCtrl",["$scope","$translate","$uibModalInstance","MotionDialerBlackList","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.insert(a.item).$promise.then(function(a){a.status>0?(e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.blacklist.list",{url:"/list",templateUrl:"app/motiondialer/blacklist/list/list.html",controller:"MotionDialerBlackListListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerBlackList",["$resource",function(a){return a("/api/rest/blacklist/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.info",{url:"/info",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerSystem",["$resource",function(a){return a("/api/rest/system/:controller",null,{properties:{method:"POST",params:{controller:"properties"}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerInfoViewCtrl",["$scope","xAlert","MotionDialerSystem",function(a,b,c){a.getProperties=function(){return c.properties().$promise.then(function(c){console.log(c),c.status>0?a.properties=c.response.RMI:b.show(c.message||"Please, check your connection!","danger")})["catch"](function(a){b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.info.view",{url:"/view",templateUrl:"app/motiondialer/info/view/view.html",controller:"MotionDialerInfoViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.info.view.about",{url:"/about",templateUrl:"app/motiondialer/info/view/view.about.html"}).state("main.motiondialer.info.view.details",{url:"/details",templateUrl:"app/motiondialer/info/view/view.details.html"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists",{url:"/lists",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerListListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerList","uiGridConstants","usSpinnerService",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"name"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs blue-hoki" href="/motiondialer/lists/view/{{row.entity.id}}/settings"><i class="icon-settings"></i></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})["finally"](function(){h.stop("spinner-grid")})},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/list/list/list.create.modal.html",controller:"MotionDialerListListCreateCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerListListCreateCtrl",["$scope","$translate","$uibModalInstance","MotionDialerList","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.save=function(){return d.insert(a.item).$promise.then(function(a){a.status>0?(e.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists.list",{url:"/list",templateUrl:"app/motiondialer/list/list/list.html",controller:"MotionDialerListListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerContact",["$resource",function(a){return a("/api/rest/contact/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").factory("MotionDialerList",["$resource",function(a){return a("/api/rest/list/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewContactCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerContact","xAlert","MotionDialerTimezone",function(a,b,c,d,e,f,g){a.form={},a.item={},a.timezones=g.list(),a.save=function(){return console.log(a.item),e.insert({id_list:parseInt(d.id),name:a.item.name,phones:a.item.phones.trim().split(","),description:a.item.description||""}).$promise.then(function(a){console.log(a),a.status>0?(f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):f.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerListContactImportModalCtrl",["$scope","$uibModalInstance","$stateParams","indexes","csv","xAlert","MotionDialerContact","MotionDialerTimezone",function(a,b,c,d,e,f,g,h){function i(b){if(b>=a.csvLength||a.stopped)return void(a.importing=!1);var d={id_list:parseInt(c.id),name:"",phones:[],description:""};return _.forOwn(a.item,function(a,c){"phones"===c?d[c].push(e[b][a]):d[c]=e[b][a]}),g.insert(d).$promise.then(function(b){b.status>0?(a["import"].success+=j,a["import"].succeeded++,k.push(b.response.RMI)):(console.log(b),a["import"].fail+=j,a["import"].failed++)})["catch"](function(b){console.log(b),a["import"].fail+=j,a["import"].failed++})["finally"](function(){i(b+1)})}a.form={},a.item={},a.timezones=h.list(),console.log(d),console.log(e),a.indexes=d,a.importing=!1,a.submitted=!1,a.stopped=!1,a["import"]={success:0,fail:0,succeeded:0,failed:0},a.csvLength=e.length;var j=100/a.csvLength,k=[];a.start=function(){a.importing=!0,a.submitted=!0,i(0)},a.close=function(){b.close(k)},a.stop=function(){a.stopped=!0}}]),angular.module("xCallyShuttleApp").controller("MotionDialerListViewCtrl",["$scope","$translate","$stateParams","$uibModal","xAlert","uiGridConstants","usSpinnerService","MotionDialerList","MotionDialerContact","Modal","FileUploader","Papa",function(a,b,c,d,e,f,g,h,i,j,k,l){a.getList=function(){return h.find({id:parseInt(c.id)}).$promise.then(function(b){b.status>0?a.list=b.response.RMI:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.updateList=function(){return h.update({id:a.list.id,name:a.list.name,description:a.list.description}).$promise.then(function(a){a.status>0?e.show(b.instant("MESSAGE_WELL_DONE"),"success"):e.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.getContacts=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"name"},{name:"phones",cellTemplate:"<div>{{row.entity.phones.join(',')}}</div>",cellClass:"ui-grid-vcenter"},{name:"description",enableSorting:!1},{name:"updatedtime",sort:{direction:f.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteContact(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},i.list({id_list:parseInt(c.id),page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.deleteContact=j.confirm["delete"](function(c){return i["delete"]({id:c}).$promise.then(function(d){d.status>0?(_.remove(a.gridOptions.data,{id:c}),e.show(b.instant("MESSAGE_WELL_DONE"),"success")):e.show(d.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})}),a.createContact=function(){var b=d.open({animation:!0,templateUrl:"app/motiondialer/list/view/view.contact.create.modal.html",controller:"MotionDialerViewContactCreateCtrl"});b.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})};var m=a.uploader=new k({queueLimit:1,clearInputAfterAddedToQueue:!0});m.onAfterAddingFile=function(b){l.parse(b._file,{header:!0,complete:function(b){a.uploader.clearQueue(),a["import"](b.data)},error:function(a){e.error(a)}})},a["import"]=function(b){var c=d.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"app/motiondialer/list/view/view.contact.import.modal.html",controller:"MotionDialerListContactImportModalCtrl",resolve:{indexes:function(){return _.keys(b[0])},csv:function(){return b}}});c.result.then(function(b){console.log(b),a.gridOptions.data=a.gridOptions.data.concat(b)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.lists.view",{url:"/view/:id",templateUrl:"app/motiondialer/list/view/view.html",controller:"MotionDialerListViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.lists.view.settings",{url:"/settings",templateUrl:"app/motiondialer/list/view/view.settings.html"}).state("main.motiondialer.lists.view.contacts",{url:"/contacts",templateUrl:"app/motiondialer/list/view/view.contacts.html"})}]),angular.module("xCallyShuttleApp").factory("MotionDialerTimezone",function(){return{list:function(){return[{group:"US (Common)",zones:[{value:"America/Puerto_Rico",name:"Puerto Rico (Atlantic)"},{value:"America/New_York",name:"New York (Eastern)"},{value:"America/Chicago",name:"Chicago (Central)"},{value:"America/Denver",name:"Denver (Mountain)"},{value:"America/Phoenix",name:"Phoenix (MST)"},{value:"America/Los_Angeles",name:"Los Angeles (Pacific)"},{value:"America/Anchorage",name:"Anchorage (Alaska)"},{value:"Pacific/Honolulu",name:"Honolulu (Hawaii)"}]},{group:"America",zones:[{value:"America/Adak",name:"Adak"},{value:"America/Anchorage",name:"Anchorage"},{value:"America/Anguilla",name:"Anguilla"},{value:"America/Antigua",name:"Antigua"},{value:"America/Araguaina",name:"Araguaina"},{value:"America/Argentina/Buenos_Aires",name:"Argentina - Buenos Aires"},{value:"America/Argentina/Catamarca",name:"Argentina - Catamarca"},{value:"America/Argentina/ComodRivadavia",name:"Argentina - ComodRivadavia"},{value:"America/Argentina/Cordoba",name:"Argentina - Cordoba"},{value:"America/Argentina/Jujuy",name:"Argentina - Jujuy"},{value:"America/Argentina/La_Rioja",name:"Argentina - La Rioja"},{value:"America/Argentina/Mendoza",name:"Argentina - Mendoza"},{value:"America/Argentina/Rio_Gallegos",name:"Argentina - Rio Gallegos"},{value:"America/Argentina/Salta",name:"Argentina - Salta"},{value:"America/Argentina/San_Juan",name:"Argentina - San Juan"},{value:"America/Argentina/San_Luis",name:"Argentina - San Luis"},{value:"America/Argentina/Tucuman",name:"Argentina - Tucuman"},{value:"America/Argentina/Ushuaia",name:"Argentina - Ushuaia"},{value:"America/Aruba",name:"Aruba"},{value:"America/Asuncion",name:"Asuncion"},{value:"America/Atikokan",name:"Atikokan"},{value:"America/Atka",name:"Atka"},{value:"America/Bahia",name:"Bahia"},{value:"America/Barbados",name:"Barbados"},{value:"America/Belem",name:"Belem"},{value:"America/Belize",name:"Belize"},{value:"America/Blanc-Sablon",name:"Blanc-Sablon"},{value:"America/Boa_Vista",name:"Boa Vista"},{value:"America/Bogota",name:"Bogota"},{value:"America/Boise",name:"Boise"},{value:"America/Buenos_Aires",name:"Buenos Aires"},{value:"America/Cambridge_Bay",name:"Cambridge Bay"},{value:"America/Campo_Grande",name:"Campo Grande"},{value:"America/Cancun",name:"Cancun"},{value:"America/Caracas",name:"Caracas"},{value:"America/Catamarca",name:"Catamarca"},{value:"America/Cayenne",name:"Cayenne"},{value:"America/Cayman",name:"Cayman"},{value:"America/Chicago",name:"Chicago"},{value:"America/Chihuahua",name:"Chihuahua"},{value:"America/Coral_Harbour",name:"Coral Harbour"},{value:"America/Cordoba",name:"Cordoba"},{value:"America/Costa_Rica",name:"Costa Rica"},{value:"America/Cuiaba",name:"Cuiaba"},{value:"America/Curacao",name:"Curacao"},{value:"America/Danmarkshavn",name:"Danmarkshavn"},{value:"America/Dawson",name:"Dawson"},{value:"America/Dawson_Creek",name:"Dawson Creek"},{value:"America/Denver",name:"Denver"},{value:"America/Detroit",name:"Detroit"},{value:"America/Dominica",name:"Dominica"},{value:"America/Edmonton",name:"Edmonton"},{value:"America/Eirunepe",name:"Eirunepe"},{value:"America/El_Salvador",name:"El Salvador"},{value:"America/Ensenada",name:"Ensenada"},{value:"America/Fortaleza",name:"Fortaleza"},{value:"America/Fort_Wayne",name:"Fort Wayne"},{value:"America/Glace_Bay",name:"Glace Bay"},{value:"America/Godthab",name:"Godthab"},{value:"America/Goose_Bay",name:"Goose Bay"},{value:"America/Grand_Turk",name:"Grand Turk"},{value:"America/Grenada",name:"Grenada"},{value:"America/Guadeloupe",name:"Guadeloupe"},{value:"America/Guatemala",name:"Guatemala"},{value:"America/Guayaquil",name:"Guayaquil"},{value:"America/Guyana",name:"Guyana"},{value:"America/Halifax",name:"Halifax"},{value:"America/Havana",name:"Havana"},{value:"America/Hermosillo",name:"Hermosillo"},{value:"America/Indiana/Indianapolis",name:"Indiana - Indianapolis"},{value:"America/Indiana/Knox",name:"Indiana - Knox"},{value:"America/Indiana/Marengo",name:"Indiana - Marengo"},{value:"America/Indiana/Petersburg",name:"Indiana - Petersburg"},{value:"America/Indiana/Tell_City",name:"Indiana - Tell City"},{value:"America/Indiana/Vevay",name:"Indiana - Vevay"},{value:"America/Indiana/Vincennes",name:"Indiana - Vincennes"},{value:"America/Indiana/Winamac",name:"Indiana - Winamac"},{value:"America/Indianapolis",name:"Indianapolis"},{value:"America/Inuvik",name:"Inuvik"},{value:"America/Iqaluit",name:"Iqaluit"},{value:"America/Jamaica",name:"Jamaica"},{value:"America/Jujuy",name:"Jujuy"},{value:"America/Juneau",name:"Juneau"},{value:"America/Kentucky/Louisville",name:"Kentucky - Louisville"},{value:"America/Kentucky/Monticello",name:"Kentucky - Monticello"},{value:"America/Knox_IN",name:"Knox IN"},{value:"America/La_Paz",name:"La Paz"},{value:"America/Lima",name:"Lima"},{value:"America/Los_Angeles",name:"Los Angeles"},{value:"America/Louisville",name:"Louisville"},{value:"America/Maceio",name:"Maceio"},{value:"America/Managua",name:"Managua"},{value:"America/Manaus",name:"Manaus"},{value:"America/Marigot",name:"Marigot"},{value:"America/Martinique",name:"Martinique"},{value:"America/Matamoros",name:"Matamoros"},{value:"America/Mazatlan",name:"Mazatlan"},{value:"America/Mendoza",name:"Mendoza"},{value:"America/Menominee",name:"Menominee"},{value:"America/Merida",name:"Merida"},{value:"America/Mexico_City",name:"Mexico City"},{value:"America/Miquelon",name:"Miquelon"},{value:"America/Moncton",name:"Moncton"},{value:"America/Monterrey",name:"Monterrey"},{value:"America/Montevideo",name:"Montevideo"},{value:"America/Montreal",name:"Montreal"},{value:"America/Montserrat",name:"Montserrat"},{value:"America/Nassau",name:"Nassau"},{value:"America/New_York",name:"New York"},{value:"America/Nipigon",name:"Nipigon"},{value:"America/Nome",name:"Nome"},{value:"America/Noronha",name:"Noronha"},{value:"America/North_Dakota/Center",name:"North Dakota - Center"},{value:"America/North_Dakota/New_Salem",name:"North Dakota - New Salem"},{value:"America/Ojinaga",name:"Ojinaga"},{value:"America/Panama",name:"Panama"},{value:"America/Pangnirtung",name:"Pangnirtung"},{value:"America/Paramaribo",name:"Paramaribo"},{value:"America/Phoenix",name:"Phoenix"},{value:"America/Port-au-Prince",name:"Port-au-Prince"},{value:"America/Porto_Acre",name:"Porto Acre"},{value:"America/Port_of_Spain",name:"Port of Spain"},{value:"America/Porto_Velho",name:"Porto Velho"},{value:"America/Puerto_Rico",name:"Puerto Rico"},{value:"America/Rainy_River",name:"Rainy River"},{value:"America/Rankin_Inlet",name:"Rankin Inlet"},{value:"America/Recife",name:"Recife"},{value:"America/Regina",name:"Regina"},{value:"America/Resolute",name:"Resolute"},{value:"America/Rio_Branco",name:"Rio Branco"},{value:"America/Rosario",name:"Rosario"},{value:"America/Santa_Isabel",name:"Santa Isabel"},{value:"America/Santarem",name:"Santarem"},{value:"America/Santiago",name:"Santiago"},{value:"America/Santo_Domingo",name:"Santo Domingo"},{value:"America/Sao_Paulo",name:"Sao Paulo"},{value:"America/Scoresbysund",name:"Scoresbysund"},{value:"America/Shiprock",name:"Shiprock"},{value:"America/St_Barthelemy",name:"St Barthelemy"},{value:"America/St_Johns",name:"St Johns"},{value:"America/St_Kitts",name:"St Kitts"},{value:"America/St_Lucia",name:"St Lucia"},{value:"America/St_Thomas",name:"St Thomas"},{value:"America/St_Vincent",name:"St Vincent"},{value:"America/Swift_Current",name:"Swift Current"},{value:"America/Tegucigalpa",name:"Tegucigalpa"},{value:"America/Thule",name:"Thule"},{value:"America/Thunder_Bay",name:"Thunder Bay"},{value:"America/Tijuana",name:"Tijuana"},{value:"America/Toronto",name:"Toronto"},{value:"America/Tortola",name:"Tortola"},{value:"America/Vancouver",name:"Vancouver"},{value:"America/Virgin",name:"Virgin"},{value:"America/Whitehorse",name:"Whitehorse"},{value:"America/Winnipeg",name:"Winnipeg"},{value:"America/Yakutat",name:"Yakutat"},{value:"America/Yellowknife",name:"Yellowknife"}]},{group:"Europe",zones:[{value:"Europe/Amsterdam",name:"Amsterdam"},{value:"Europe/Andorra",name:"Andorra"},{value:"Europe/Athens",name:"Athens"},{value:"Europe/Belfast",name:"Belfast"},{value:"Europe/Belgrade",name:"Belgrade"},{value:"Europe/Berlin",name:"Berlin"},{value:"Europe/Bratislava",name:"Bratislava"},{value:"Europe/Brussels",name:"Brussels"},{value:"Europe/Bucharest",name:"Bucharest"},{value:"Europe/Budapest",name:"Budapest"},{value:"Europe/Chisinau",name:"Chisinau"},{value:"Europe/Copenhagen",name:"Copenhagen"},{value:"Europe/Dublin",name:"Dublin"},{value:"Europe/Gibraltar",name:"Gibraltar"},{value:"Europe/Guernsey",name:"Guernsey"},{value:"Europe/Helsinki",name:"Helsinki"},{value:"Europe/Isle_of_Man",name:"Isle of Man"},{value:"Europe/Istanbul",name:"Istanbul"},{value:"Europe/Jersey",name:"Jersey"},{value:"Europe/Kaliningrad",name:"Kaliningrad"},{value:"Europe/Kiev",name:"Kiev"},{value:"Europe/Lisbon",name:"Lisbon"},{value:"Europe/Ljubljana",name:"Ljubljana"},{value:"Europe/London",name:"London"},{value:"Europe/Luxembourg",name:"Luxembourg"},{value:"Europe/Madrid",name:"Madrid"},{value:"Europe/Malta",name:"Malta"},{value:"Europe/Mariehamn",name:"Mariehamn"},{value:"Europe/Minsk",name:"Minsk"},{value:"Europe/Monaco",name:"Monaco"},{value:"Europe/Moscow",name:"Moscow"},{value:"Europe/Nicosia",name:"Nicosia"},{value:"Europe/Oslo",name:"Oslo"},{value:"Europe/Paris",name:"Paris"},{value:"Europe/Podgorica",name:"Podgorica"},{value:"Europe/Prague",name:"Prague"},{value:"Europe/Riga",name:"Riga"},{value:"Europe/Rome",name:"Rome"},{value:"Europe/Samara",name:"Samara"},{value:"Europe/San_Marino",name:"San Marino"},{value:"Europe/Sarajevo",name:"Sarajevo"},{value:"Europe/Simferopol",name:"Simferopol"},{value:"Europe/Skopje",name:"Skopje"},{value:"Europe/Sofia",name:"Sofia"},{value:"Europe/Stockholm",name:"Stockholm"},{value:"Europe/Tallinn",name:"Tallinn"},{value:"Europe/Tirane",name:"Tirane"},{value:"Europe/Tiraspol",name:"Tiraspol"},{value:"Europe/Uzhgorod",name:"Uzhgorod"},{value:"Europe/Vaduz",name:"Vaduz"},{value:"Europe/Vatican",name:"Vatican"},{value:"Europe/Vienna",name:"Vienna"},{value:"Europe/Vilnius",name:"Vilnius"},{value:"Europe/Volgograd",name:"Volgograd"},{value:"Europe/Warsaw",name:"Warsaw"},{value:"Europe/Zagreb",name:"Zagreb"},{value:"Europe/Zaporozhye",name:"Zaporozhye"},{value:"Europe/Zurich",name:"Zurich"}]},{group:"Asia",zones:[{value:"Asia/Aden",name:"Aden"},{value:"Asia/Almaty",name:"Almaty"},{value:"Asia/Amman",name:"Amman"},{value:"Asia/Anadyr",name:"Anadyr"},{value:"Asia/Aqtau",name:"Aqtau"},{value:"Asia/Aqtobe",name:"Aqtobe"},{value:"Asia/Ashgabat",name:"Ashgabat"},{value:"Asia/Ashkhabad",name:"Ashkhabad"},{value:"Asia/Baghdad",name:"Baghdad"},{value:"Asia/Bahrain",name:"Bahrain"},{value:"Asia/Baku",name:"Baku"},{value:"Asia/Bangkok",name:"Bangkok"},{value:"Asia/Beirut",name:"Beirut"},{value:"Asia/Bishkek",name:"Bishkek"},{value:"Asia/Brunei",name:"Brunei"},{value:"Asia/Calcutta",name:"Calcutta"},{value:"Asia/Choibalsan",name:"Choibalsan"},{value:"Asia/Chongqing",name:"Chongqing"},{value:"Asia/Chungking",name:"Chungking"},{value:"Asia/Colombo",name:"Colombo"},{value:"Asia/Dacca",name:"Dacca"},{value:"Asia/Damascus",name:"Damascus"},{value:"Asia/Dhaka",name:"Dhaka"},{value:"Asia/Dili",name:"Dili"},{value:"Asia/Dubai",name:"Dubai"},{value:"Asia/Dushanbe",name:"Dushanbe"},{value:"Asia/Gaza",name:"Gaza"},{value:"Asia/Harbin",name:"Harbin"},{value:"Asia/Ho_Chi_Minh",name:"Ho Chi Minh"},{value:"Asia/Hong_Kong",name:"Hong Kong"},{value:"Asia/Hovd",name:"Hovd"},{value:"Asia/Irkutsk",name:"Irkutsk"},{value:"Asia/Istanbul",name:"Istanbul"},{value:"Asia/Jakarta",name:"Jakarta"},{value:"Asia/Jayapura",name:"Jayapura"},{value:"Asia/Jerusalem",name:"Jerusalem"},{value:"Asia/Kabul",name:"Kabul"},{value:"Asia/Kamchatka",name:"Kamchatka"},{value:"Asia/Karachi",name:"Karachi"},{value:"Asia/Kashgar",name:"Kashgar"},{value:"Asia/Kathmandu",name:"Kathmandu"},{value:"Asia/Katmandu",name:"Katmandu"},{value:"Asia/Kolkata",name:"Kolkata"},{value:"Asia/Krasnoyarsk",name:"Krasnoyarsk"},{value:"Asia/Kuala_Lumpur",name:"Kuala Lumpur"},{value:"Asia/Kuching",name:"Kuching"},{value:"Asia/Kuwait",name:"Kuwait"},{value:"Asia/Macao",name:"Macao"},{value:"Asia/Macau",name:"Macau"},{value:"Asia/Magadan",name:"Magadan"},{value:"Asia/Makassar",name:"Makassar"},{value:"Asia/Manila",name:"Manila"},{value:"Asia/Muscat",name:"Muscat"},{value:"Asia/Nicosia",name:"Nicosia"},{value:"Asia/Novokuznetsk",name:"Novokuznetsk"},{value:"Asia/Novosibirsk",name:"Novosibirsk"},{value:"Asia/Omsk",name:"Omsk"},{value:"Asia/Oral",name:"Oral"},{value:"Asia/Phnom_Penh",name:"Phnom Penh"},{value:"Asia/Pontianak",name:"Pontianak"},{value:"Asia/Pyongyang",name:"Pyongyang"},{value:"Asia/Qatar",name:"Qatar"},{value:"Asia/Qyzylorda",name:"Qyzylorda"},{value:"Asia/Rangoon",name:"Rangoon"},{value:"Asia/Riyadh",name:"Riyadh"},{value:"Asia/Saigon",name:"Saigon"},{value:"Asia/Sakhalin",name:"Sakhalin"},{value:"Asia/Samarkand",name:"Samarkand"},{value:"Asia/Seoul",name:"Seoul"},{value:"Asia/Shanghai",name:"Shanghai"},{value:"Asia/Singapore",name:"Singapore"},{value:"Asia/Taipei",name:"Taipei"},{value:"Asia/Tashkent",name:"Tashkent"},{value:"Asia/Tbilisi",name:"Tbilisi"},{value:"Asia/Tehran",name:"Tehran"},{value:"Asia/Tel_Aviv",name:"Tel Aviv"},{value:"Asia/Thimbu",name:"Thimbu"},{value:"Asia/Thimphu",name:"Thimphu"},{value:"Asia/Tokyo",name:"Tokyo"},{value:"Asia/Ujung_Pandang",name:"Ujung Pandang"},{value:"Asia/Ulaanbaatar",name:"Ulaanbaatar"},{value:"Asia/Ulan_Bator",name:"Ulan Bator"},{value:"Asia/Urumqi",name:"Urumqi"},{value:"Asia/Vientiane",name:"Vientiane"},{value:"Asia/Vladivostok",name:"Vladivostok"},{value:"Asia/Yakutsk",name:"Yakutsk"},{value:"Asia/Yekaterinburg",name:"Yekaterinburg"},{value:"Asia/Yerevan",name:"Yerevan"}]},{group:"Africa",zones:[{value:"Africa/Abidjan",name:"Abidjan"},{value:"Africa/Accra",name:"Accra"},{value:"Africa/Addis_Ababa",name:"Addis Ababa"},{value:"Africa/Algiers",name:"Algiers"},{value:"Africa/Asmara",name:"Asmara"
+},{value:"Africa/Asmera",name:"Asmera"},{value:"Africa/Bamako",name:"Bamako"},{value:"Africa/Bangui",name:"Bangui"},{value:"Africa/Banjul",name:"Banjul"},{value:"Africa/Bissau",name:"Bissau"},{value:"Africa/Blantyre",name:"Blantyre"},{value:"Africa/Brazzaville",name:"Brazzaville"},{value:"Africa/Bujumbura",name:"Bujumbura"},{value:"Africa/Cairo",name:"Cairo"},{value:"Africa/Casablanca",name:"Casablanca"},{value:"Africa/Ceuta",name:"Ceuta"},{value:"Africa/Conakry",name:"Conakry"},{value:"Africa/Dakar",name:"Dakar"},{value:"Africa/Dar_es_Salaam",name:"Dar es Salaam"},{value:"Africa/Djibouti",name:"Djibouti"},{value:"Africa/Douala",name:"Douala"},{value:"Africa/El_Aaiun",name:"El Aaiun"},{value:"Africa/Freetown",name:"Freetown"},{value:"Africa/Gaborone",name:"Gaborone"},{value:"Africa/Harare",name:"Harare"},{value:"Africa/Johannesburg",name:"Johannesburg"},{value:"Africa/Kampala",name:"Kampala"},{value:"Africa/Khartoum",name:"Khartoum"},{value:"Africa/Kigali",name:"Kigali"},{value:"Africa/Kinshasa",name:"Kinshasa"},{value:"Africa/Lagos",name:"Lagos"},{value:"Africa/Libreville",name:"Libreville"},{value:"Africa/Lome",name:"Lome"},{value:"Africa/Luanda",name:"Luanda"},{value:"Africa/Lubumbashi",name:"Lubumbashi"},{value:"Africa/Lusaka",name:"Lusaka"},{value:"Africa/Malabo",name:"Malabo"},{value:"Africa/Maputo",name:"Maputo"},{value:"Africa/Maseru",name:"Maseru"},{value:"Africa/Mbabane",name:"Mbabane"},{value:"Africa/Mogadishu",name:"Mogadishu"},{value:"Africa/Monrovia",name:"Monrovia"},{value:"Africa/Nairobi",name:"Nairobi"},{value:"Africa/Ndjamena",name:"Ndjamena"},{value:"Africa/Niamey",name:"Niamey"},{value:"Africa/Nouakchott",name:"Nouakchott"},{value:"Africa/Ouagadougou",name:"Ouagadougou"},{value:"Africa/Porto-Novo",name:"Porto-Novo"},{value:"Africa/Sao_Tome",name:"Sao Tome"},{value:"Africa/Timbuktu",name:"Timbuktu"},{value:"Africa/Tripoli",name:"Tripoli"},{value:"Africa/Tunis",name:"Tunis"},{value:"Africa/Windhoek",name:"Windhoek"}]},{group:"Australia",zones:[{value:"Australia/ACT",name:"ACT"},{value:"Australia/Adelaide",name:"Adelaide"},{value:"Australia/Brisbane",name:"Brisbane"},{value:"Australia/Broken_Hill",name:"Broken Hill"},{value:"Australia/Canberra",name:"Canberra"},{value:"Australia/Currie",name:"Currie"},{value:"Australia/Darwin",name:"Darwin"},{value:"Australia/Eucla",name:"Eucla"},{value:"Australia/Hobart",name:"Hobart"},{value:"Australia/LHI",name:"LHI"},{value:"Australia/Lindeman",name:"Lindeman"},{value:"Australia/Lord_Howe",name:"Lord Howe"},{value:"Australia/Melbourne",name:"Melbourne"},{value:"Australia/North",name:"North"},{value:"Australia/NSW",name:"NSW"},{value:"Australia/Perth",name:"Perth"},{value:"Australia/Queensland",name:"Queensland"},{value:"Australia/South",name:"South"},{value:"Australia/Sydney",name:"Sydney"},{value:"Australia/Tasmania",name:"Tasmania"},{value:"Australia/Victoria",name:"Victoria"},{value:"Australia/West",name:"West"},{value:"Australia/Yancowinna",name:"Yancowinna"}]},{group:"Indian",zones:[{value:"Indian/Antananarivo",name:"Antananarivo"},{value:"Indian/Chagos",name:"Chagos"},{value:"Indian/Christmas",name:"Christmas"},{value:"Indian/Cocos",name:"Cocos"},{value:"Indian/Comoro",name:"Comoro"},{value:"Indian/Kerguelen",name:"Kerguelen"},{value:"Indian/Mahe",name:"Mahe"},{value:"Indian/Maldives",name:"Maldives"},{value:"Indian/Mauritius",name:"Mauritius"},{value:"Indian/Mayotte",name:"Mayotte"},{value:"Indian/Reunion",name:"Reunion"}]},{group:"Atlantic",zones:[{value:"Atlantic/Azores",name:"Azores"},{value:"Atlantic/Bermuda",name:"Bermuda"},{value:"Atlantic/Canary",name:"Canary"},{value:"Atlantic/Cape_Verde",name:"Cape Verde"},{value:"Atlantic/Faeroe",name:"Faeroe"},{value:"Atlantic/Faroe",name:"Faroe"},{value:"Atlantic/Jan_Mayen",name:"Jan Mayen"},{value:"Atlantic/Madeira",name:"Madeira"},{value:"Atlantic/Reykjavik",name:"Reykjavik"},{value:"Atlantic/South_Georgia",name:"South Georgia"},{value:"Atlantic/Stanley",name:"Stanley"},{value:"Atlantic/St_Helena",name:"St Helena"}]},{group:"Pacific",zones:[{value:"Pacific/Apia",name:"Apia"},{value:"Pacific/Auckland",name:"Auckland"},{value:"Pacific/Chatham",name:"Chatham"},{value:"Pacific/Easter",name:"Easter"},{value:"Pacific/Efate",name:"Efate"},{value:"Pacific/Enderbury",name:"Enderbury"},{value:"Pacific/Fakaofo",name:"Fakaofo"},{value:"Pacific/Fiji",name:"Fiji"},{value:"Pacific/Funafuti",name:"Funafuti"},{value:"Pacific/Galapagos",name:"Galapagos"},{value:"Pacific/Gambier",name:"Gambier"},{value:"Pacific/Guadalcanal",name:"Guadalcanal"},{value:"Pacific/Guam",name:"Guam"},{value:"Pacific/Honolulu",name:"Honolulu"},{value:"Pacific/Johnston",name:"Johnston"},{value:"Pacific/Kiritimati",name:"Kiritimati"},{value:"Pacific/Kosrae",name:"Kosrae"},{value:"Pacific/Kwajalein",name:"Kwajalein"},{value:"Pacific/Majuro",name:"Majuro"},{value:"Pacific/Marquesas",name:"Marquesas"},{value:"Pacific/Midway",name:"Midway"},{value:"Pacific/Nauru",name:"Nauru"},{value:"Pacific/Niue",name:"Niue"},{value:"Pacific/Norfolk",name:"Norfolk"},{value:"Pacific/Noumea",name:"Noumea"},{value:"Pacific/Pago_Pago",name:"Pago Pago"},{value:"Pacific/Palau",name:"Palau"},{value:"Pacific/Pitcairn",name:"Pitcairn"},{value:"Pacific/Ponape",name:"Ponape"},{value:"Pacific/Port_Moresby",name:"Port Moresby"},{value:"Pacific/Rarotonga",name:"Rarotonga"},{value:"Pacific/Saipan",name:"Saipan"},{value:"Pacific/Samoa",name:"Samoa"},{value:"Pacific/Tahiti",name:"Tahiti"},{value:"Pacific/Tarawa",name:"Tarawa"},{value:"Pacific/Tongatapu",name:"Tongatapu"},{value:"Pacific/Truk",name:"Truk"},{value:"Pacific/Wake",name:"Wake"},{value:"Pacific/Wallis",name:"Wallis"},{value:"Pacific/Yap",name:"Yap"}]},{group:"Antarctica",zones:[{value:"Antarctica/Casey",name:"Casey"},{value:"Antarctica/Davis",name:"Davis"},{value:"Antarctica/DumontDUrville",name:"DumontDUrville"},{value:"Antarctica/Macquarie",name:"Macquarie"},{value:"Antarctica/Mawson",name:"Mawson"},{value:"Antarctica/McMurdo",name:"McMurdo"},{value:"Antarctica/Palmer",name:"Palmer"},{value:"Antarctica/Rothera",name:"Rothera"},{value:"Antarctica/South_Pole",name:"South Pole"},{value:"Antarctica/Syowa",name:"Syowa"},{value:"Antarctica/Vostok",name:"Vostok"}]},{group:"Arctic",zones:[{value:"Arctic/Longyearbyen",name:"Longyearbyen"}]},{group:"UTC",zones:[{value:"UTC",name:"UTC"}]},{group:"Manual Offsets",zones:[{value:"UTC-12",name:"UTC-12"},{value:"UTC-11",name:"UTC-11"},{value:"UTC-10",name:"UTC-10"},{value:"UTC-9",name:"UTC-9"},{value:"UTC-8",name:"UTC-8"},{value:"UTC-7",name:"UTC-7"},{value:"UTC-6",name:"UTC-6"},{value:"UTC-5",name:"UTC-5"},{value:"UTC-4",name:"UTC-4"},{value:"UTC-3",name:"UTC-3"},{value:"UTC-2",name:"UTC-2"},{value:"UTC-1",name:"UTC-1"},{value:"UTC+0",name:"UTC+0"},{value:"UTC+1",name:"UTC+1"},{value:"UTC+2",name:"UTC+2"},{value:"UTC+3",name:"UTC+3"},{value:"UTC+4",name:"UTC+4"},{value:"UTC+5",name:"UTC+5"},{value:"UTC+6",name:"UTC+6"},{value:"UTC+7",name:"UTC+7"},{value:"UTC+8",name:"UTC+8"},{value:"UTC+9",name:"UTC+9"},{value:"UTC+10",name:"UTC+10"},{value:"UTC+11",name:"UTC+11"},{value:"UTC+12",name:"UTC+12"},{value:"UTC+13",name:"UTC+13"},{value:"UTC+14",name:"UTC+14"}]}]}}}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer",{url:"/motiondialer",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:16}}})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCtrl",["$scope","$uibModal","$translate","xAlert","Modal","MotionDialerProcess","uiGridConstants","usSpinnerService",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,columnDefs:[{name:"id",width:60},{name:"name"},{name:"queue",enableSorting:!1},{name:"extension",enableSorting:!1},{name:"id_list",enableSorting:!1,cellTemplate:'<div><a class="btn btn-xs grey-cascade" href="/motiondialer/lists/view/{{row.entity.id_list}}/settings">{{row.entity.id_list}}</a></div>',cellClass:"ui-grid-vcenter"},{name:"status",cellTemplate:"<div><a class=\"btn btn-xs\" data-ng-class=\"row.entity.status == 'STOP' ? 'red-sunglo' : 'green-meadow'\" data-ng-href=\"#\">{{ (row.entity.status === 'RUN') ? 'RUNNING' : 'STOPPED'}}</a></div>",cellClass:"ui-grid-vcenter",filter:{type:g.filter.SELECT,selectOptions:[{value:"RUN",label:"RUNNING"},{value:"STOP",label:"STOPPED"}]}},{name:"updatedtime",sort:{direction:g.DESC},enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs blue-hoki" href="/motiondialer/processes/view/{{row.entity.id}}/overview"><i class="icon-settings"></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteItem(row.entity.name, row.entity.id)"><i class="icon-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},f.list({page:1,size:6e5}).$promise.then(function(b){console.log(b),b.status>0?a.gridOptions.data=b.response.RMI.rows:d.show("Please, check your connection!","danger")})["catch"](function(a){d.error(a)})["finally"](function(){h.stop("spinner-grid")})},a.createProcessQueue=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/process/list/list.create.queue.modal.html",controller:"MotionDialerProcessListCreateQueueCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.createProcessSquare=function(){var c=b.open({animation:!0,templateUrl:"app/motiondialer/process/list/list.create.square.modal.html",controller:"MotionDialerProcessListCreateSquareCtrl"});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.deleteItem=e.confirm["delete"](function(b){return f["delete"]({id:b}).$promise.then(function(e){e.status>0?(_.remove(a.gridOptions.data,{id:b}),d.show(c.instant("MESSAGE_WELL_DONE"),"success")):d.show(e.message||"Please, check your connection!","danger")})["catch"](function(a){d.error(a)})})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCreateQueueCtrl",["$scope","$translate","$uibModalInstance","MotionDialerProcess","MotionDialerList","Trunk","VoiceQueue","Route","xAlert",function(a,b,c,d,e,f,g,h,i){a.form={},a.item={fetch_sort:"ASC",timeout:3},a.initModal=function(){return g.get().$promise.then(function(b){return a.queues={},b&&(a.queues=b.rows),f.get().$promise}).then(function(b){return a.trunks={},b&&(a.trunks=b.rows),a.trunks.push({name:"fake"}),e.list({page:1,size:6e5}).$promise}).then(function(b){a.lists={},b.status>0?a.lists=b.response.RMI.rows:i.show("Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.save=function(){console.log(a.item);var e="process_"+a.item.name+"_queue_"+a.item.queue.name+"_"+Math.round(1e5*Math.random()),f="Generated by Motion Dialer, Process Queue"+(a.item.description?", "+a.item.description:"");return h.save({appdata:"Internal Call",context:"from-sip",exten:e.replace(/\s/g,"_"),type:"internal",description:f,Applications:[{appdata:["CDR(type)=tigerdial"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:["QUEUE_PRIO=99"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:[a.item.queue.name,"","","",a.item.timeout],app:"Queue",interval:"*,*,*,*",type:"internal"}]}).$promise.then(function(b){return console.log(b),d.insert({name:a.item.name,id_list:a.item.list.id,queue:a.item.queue.name,device:a.item.device.name,context:"from-sip",extension:e.replace(/\s/g,"_"),description:a.item.description,auto_closed:!0,fetch_sort:a.item.fetch_sort}).$promise}).then(function(a){a.status>0?(i.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):i.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessListCreateSquareCtrl",["$scope","$translate","$uibModalInstance","MotionDialerProcess","MotionDialerList","SquareProject","Trunk","Route","xAlert",function(a,b,c,d,e,f,g,h,i){a.form={},a.item={fetch_sort:"ASC"},a.initModal=function(){return f.get().$promise.then(function(b){return a.projects={},b&&(a.projects=b.rows),g.get().$promise}).then(function(b){return a.trunks={},b&&(a.trunks=b.rows),a.trunks.push({name:"fake"}),e.list({page:1,size:6e5}).$promise}).then(function(b){a.lists={},b.status>0?a.lists=b.response.RMI.rows:i.show("Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.save=function(){console.log(a.item);var e="process_"+a.item.name+"_square_"+a.item.project.name+"_"+Math.round(1e5*Math.random()),f="Generated by Motion Dialer, Process Square"+(a.item.description?", "+a.item.description:"");return h.save({appdata:"Internal Call",context:"from-sip",exten:e.replace(/\s/g,"_"),type:"internal",description:f,Applications:[{appdata:["CDR(type)=tigerdial"],app:"Set",interval:"*,*,*,*",type:"internal"},{appdata:["agi://127.0.0.1/square",a.item.project.name],app:"AGI",interval:"*,*,*,*",type:"internal"}]}).$promise.then(function(b){return console.log(b),d.insert({name:a.item.name,id_list:a.item.list.id,queue:"none",device:a.item.device.name,context:"from-sip",extension:e.replace(/\s/g,"_"),description:a.item.description,auto_closed:!0,channel_limit:15,fetch_sort:a.item.fetch_sort}).$promise}).then(function(a){a.status>0?(i.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)):i.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){i.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes.list",{url:"/list",templateUrl:"app/motiondialer/process/list/list.html",controller:"MotionDialerProcessListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").factory("MotionDialerProcess",["$resource",function(a){return a("/api/rest/process/:controller",null,{list:{method:"POST",params:{controller:"list"}},insert:{method:"POST",params:{controller:"insert"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},update:{method:"POST",params:{controller:"update"}}})}]),angular.module("xCallyShuttleApp").factory("MotionDialerSpooler",["$resource",function(a){return a("/api/rest/spooler/:controller/:retrieve/:peer",null,{list:{method:"POST",params:{controller:"list"}},"delete":{method:"POST",params:{controller:"delete"}},find:{method:"POST",params:{controller:"find"}},summary:{method:"POST",params:{controller:"summary"}},close:{method:"POST",params:{controller:"retrieve",retrieve:"close"}},open:{method:"POST",params:{controller:"retrieve",retrieve:"open"}},blacklist:{method:"POST",params:{controller:"retrieve",retrieve:"blacklist"}},planning:{method:"POST",params:{controller:"retrieve",retrieve:"planning"}},planningpeer:{method:"POST",params:{controller:"retrieve",retrieve:"planning",peer:"peer"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes",{url:"/processes",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("MotionDialerProcessViewCtrl",["$scope","$translate","$stateParams","$uibModal","xAlert","uiGridConstants","usSpinnerService","MotionDialerProcess","MotionDialerSpooler","Modal","VoiceQueue",function(a,b,c,d,e,f,g,h,i,j,k){a.process={},a.techs=["SIP","IAX","LOCAL","KHOMP"],a.dialFormats=["tech/device/number","tech/number@device"],a.checkDuplicates=["ALWAYS","IFOPEN","NO"],a.codecs=["g729","ilbc","gsm","ulaw","alaw"],a.getProcess=function(){return h.find({id:parseInt(c.id)}).$promise.then(function(b){console.log(b),b.status>0?(b.response.RMI.codecs=b.response.RMI.codecs.split(","),a.process=b.response.RMI):e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})},a.getSummary=function(){return i.summary({id_process:parseInt(c.id)}).$promise.then(function(b){if(b.status>0){a.summary=b.response.RMI.totals,a.total=0;for(var c=0;c<a.summary.length;c++)a.total+=a.summary[c][1]}else e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.updateProcess=function(){var c=_.clone(a.process);return delete c.updatedtime,delete c.id_list,delete c.createdtime,delete c.runtime,delete c.fetch_sort,c.codecs=c.codecs.join(","),""===c.timezone&&delete c.timezone,h.update(c).$promise.then(function(c){c.status>0?(c.response.RMI.codecs=c.response.RMI.codecs.split(","),a.process=c.response.RMI,e.show(b.instant("MESSAGE_WELL_DONE"),"success")):c.response.RMI.errors.forEach(function(a){a?e.show(a.field+": "+a.error,"danger"):e.show("Please, check your connection!","danger")})})["catch"](function(a){e.error(a)})},a.getSpooler=function(){return a.gridOptions={paginationPageSizes:[10,25,50,75],paginationPageSize:10,enableFiltering:!0,enableSorting:!0,enableGridMenu:!0,flatEntityAccess:!0,showGridFooter:!0,fastWatch:!0,headerCellFilter:"translate",columnDefs:[{name:"name"},{name:"phones",cellTemplate:"<div>{{row.entity.phones.join(',')}}</div>",cellClass:"ui-grid-vcenter"},{name:"retrieve",filter:{type:f.filter.SELECT,selectOptions:[{value:"PLANNED_PEER",label:"PLANNED PEER"},{value:"PLANNED",label:"PLANNED"},{value:"BLACK_LIST",label:"BLACKLIST"},{value:"OPEN",label:"OPEN"},{value:"CLOSED",label:"CLOSED"},{value:"MAX_ATTEMPTS",label:"MAX ATTEMPTS"},{value:"COUNTER_BLOCK",label:"COUNTER BLOCK"},{value:"PLANNED_REQUEST",label:"PLANNED REQUEST"},{value:"DELETE",label:"DELETE"}]}},{name:"counter",enableFiltering:!1},{name:"planningtime",cellTemplate:"<div>{{row.entity.planningtime | date:'yyyy-MM-dd HH:mm'}}</div>",cellClass:"ui-grid-vcenter",enableFiltering:!1},{name:"action",cellTemplate:'<div><a class="btn btn-xs green" data-ng-click="grid.appScope.historySpooler(row.entity.history)"><i class="icon-info"></i></a> <a class="btn btn-xs blue-hoki" data-ng-click="grid.appScope.editSpooler(row.entity)"><i class="icon-settings"></i></a> <a class="btn btn-xs red-sunglo" data-ng-click="grid.appScope.deleteSpooler(row.entity.phones.join(), row.entity.id)"><i class="fa fa-trash"></i></a></div>',enableSorting:!1,cellClass:"ui-grid-vcenter",enableFiltering:!1}]},i.list({id_process:parseInt(c.id),page:1,size:6e5}).$promise.then(function(b){b.status>0?a.gridOptions.data=b.response.RMI.rows:e.show(b.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})["finally"](function(){g.stop("spinner-grid")})},a.deleteSpooler=j.confirm["delete"](function(c){return i["delete"]({id:c}).$promise.then(function(d){d.status>0?(_.remove(a.gridOptions.data,{id:c}),e.show(b.instant("MESSAGE_WELL_DONE"),"success")):e.show(d.message||"Please, check your connection!","danger")})["catch"](function(a){e.error(a)})}),a.historySpooler=function(b){var c=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.spooler.history.modal.html",controller:"MotionDialerViewSpoolerHistoryCtrl",resolve:{historySpooler:function(){return b}}});c.result.then(function(b){a.gridOptions.data.push(b.response.RMI)})},a.editSpooler=function(a){var b=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.spooler.edit.modal.html",controller:"MotionDialerViewSpoolerEditCtrl",resolve:{entitySpooler:function(){return a}}});b.result.then(function(){})},a.initSettings=function(){return a.queues=null,k.get().$promise.then(function(b){b&&(a.queues=b.rows,a.process.queue&&"none"!==a.process.queue&&(a.queue=_.find(b.rows,{name:a.process.queue})))})["catch"](function(a){e.error(a)})},a.createInterval=function(b){var c=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.create.interval.modal.html",controller:"MotionDialerViewCreateIntervalCtrl",resolve:{objectProcess:function(){return a.process},intervalType:function(){return b},intervalValue:function(){return b?"8:00-20:00|MON-FRI|*|*":"00:01-07:59|SAT-SUN|*|*"}}});c.result.then(function(b){a.process=b})},a.editInterval=function(b,c){var e=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.create.interval.modal.html",controller:"MotionDialerViewCreateIntervalCtrl",resolve:{objectProcess:function(){return a.process},intervalType:function(){return b},intervalValue:function(){return c}}});e.result.then(function(b){a.process=b})},a.deleteInterval=j.confirm["delete"](function(c,d){var f={id:a.process.id};return d?(f.intervals=[],f.intervals=f.intervals.concat(a.process.intervals),f.intervals.splice(c,1)):(f.not_intervals=[],f.not_intervals=f.not_intervals.concat(a.process.not_intervals),f.not_intervals.splice(c,1)),h.update(f).$promise.then(function(c){c.status>0?(c.response.RMI.codecs=c.response.RMI.codecs.split(","),a.process=c.response.RMI,e.show(b.instant("MESSAGE_WELL_DONE"),"success")):c.response.RMI.errors.forEach(function(a){a?e.show(a.field+": "+a.error,"danger"):e.show("Please, check your connection!","danger")})})["catch"](function(a){e.error(a)})}),a.runOrStop=function(){var b=d.open({animation:!0,templateUrl:"app/motiondialer/process/view/view.run.process.modal.html",controller:"MotionDialerViewRunProcessCtrl",resolve:{statusProcess:function(){return a.process.status}}});b.result.then(function(b){a.process.status=b.status})}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewCreateIntervalCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerProcess","xAlert","objectProcess","intervalType","intervalValue","interval",function(a,b,c,d,e,f,g,h,i,j){function k(a){var b,c=a.split("|"),d={};return c.forEach(function(a,c){switch(c){case 0:"*"!==a?(b=a.split("-"),d.t_from=moment(b[0],"HH:mm"),d.t_to=moment(b[1],"HH:mm"),d.alwaysTime=!1):(d.t_from=moment(new Date),d.t_to=moment(new Date),d.alwaysTime=!0);break;case 1:"*"!==a?(b=a.split("-"),d.wd_from=b[0].toLowerCase(),d.wd_to=b[1]?b[1].toLowerCase():"always"):(d.wd_from="always",d.wd_to="always");break;case 2:"*"!==a?(b=a.split("-"),d.md_from=b[0],d.md_to=b[1]?b[1]:"always"):(d.md_from="always",d.md_to="always");break;case 3:"*"!==a?(b=a.split("-"),d.m_from=b[0],d.m_to=b[1]?b[1]:"always"):(d.m_from="always",d.m_to="always")}}),d}function l(a){var b,c,d,e;return b=a.t_from&&a.t_to&&!a.alwaysTime?moment(a.t_from).format("HH:mm")+"-"+moment(a.t_to).format("HH:mm"):"*",a.wd_from&&"always"!==a.wd_from?(c=a.wd_from.toUpperCase(),a.wd_to&&"always"!==a.wd_to&&(c+="-"+a.wd_to.toUpperCase())):c="*",a.md_from&&"always"!==a.md_from?(d=a.md_from,a.md_to&&"always"!==a.md_to&&(d+="-"+a.md_to)):d="*",a.m_from&&"always"!==a.m_from?(e=a.m_from,a.m_to&&"always"!==a.m_to&&(e+="-"+a.m_to)):e="*",b+"|"+c+"|"+d+"|"+e}a.form={},a.$interval=j.interval,a.splittedInterval=k(i),a.save=function(){var d=l(a.splittedInterval);console.log(d);var i={id:g.id};return h?(i.intervals=[],i.intervals=i.intervals.concat(g.intervals),i.intervals.push(d)):(i.not_intervals=[],i.not_intervals=i.not_intervals.concat(g.not_intervals),i.not_intervals.push(d)),console.log(i),e.update(i).$promise.then(function(a){a.status>0?(a.response.RMI.codecs=a.response.RMI.codecs.split(","),f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a.response.RMI)):a.response.RMI.errors.forEach(function(a){a?f.show(a.field+": "+a.error,"danger"):f.show("Please, check your connection!","danger")})})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.motiondialer.processes.view",{url:"/view/:id",templateUrl:"app/motiondialer/process/view/view.html",controller:"MotionDialerProcessViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.motiondialer.processes.view.overview",{url:"/overview",templateUrl:"app/motiondialer/process/view/view.overview.html"}).state("main.motiondialer.processes.view.settings",{url:"/settings",templateUrl:"app/motiondialer/process/view/view.settings.html"}).state("main.motiondialer.processes.view.intervals",{url:"/intervals",templateUrl:"app/motiondialer/process/view/view.intervals.html"}).state("main.motiondialer.processes.view.spooler",{url:"/spooler",templateUrl:"app/motiondialer/process/view/view.spooler.html"})}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewRunProcessCtrl",["$scope","$stateParams","$uibModalInstance","$translate","statusProcess","MotionDialerProcess","xAlert",function(a,b,c,d,e,f,g){a.status="RUN"===e?"STOP":"RUN",a.yes=function(){f.update({id:parseInt(b.id),status:a.status}).$promise.then(function(a){a.status>0?(g.show(d.instant("MESSAGE_WELL_DONE"),"success"),c.close(a.response.RMI)):g.show(a.message||"Please, check your connection!","danger")})["catch"](function(a){g.error(a)})},a.no=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewSpoolerEditCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerSpooler","xAlert","entitySpooler","Agent",function(a,b,c,d,e,f,g,h){a.moment=moment,a.initModal=function(){return h.get().$promise.then(function(b){a.agents=[],b&&b.rows.forEach(function(b){a.agents.push("SIP/"+b.name)})})["catch"](function(a){f.error(a)})},a.entitySpooler=g,a.save=function(){var d;switch(a.entitySpooler.retrieve){case"CLOSED":d=e.close({id:parseInt(a.entitySpooler.id)});break;case"OPEN":d=e.open({id:parseInt(a.entitySpooler.id)});break;case"BLACK_LIST":d=e.blacklist({id:parseInt(a.entitySpooler.id)});break;case"PLANNED":d=e.planning({id:parseInt(a.entitySpooler.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm")});break;case"PLANNED_PEER":d=e.planningpeer({id:parseInt(a.entitySpooler.id),date:moment(a.entitySpooler.planningtime).format("YYYY-MM-DD HH:mm"),peer:a.entitySpooler.planningpeer})}d?d.$promise.then(function(a){console.log(a),a.status>0?(f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close()):a.response.RMI.errors.forEach(function(a){a?f.show(a.field+": "+a.error,"danger"):f.show("Please, check your connection!","danger")})})["catch"](function(a){f.error(a)}):f.show("RETRIEVE NOT FOUND","danger")},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("MotionDialerViewSpoolerHistoryCtrl",["$scope","$translate","$uibModalInstance","$stateParams","MotionDialerSpooler","xAlert","historySpooler",function(a,b,c,d,e,f,g){a.historySpooler=g,a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("ResetCtrl",["$scope","Auth","$location","$window","$rootScope","Setting","xAlert","$stateParams","$state",function(a,b,c,d,e,f,g,h,i){a.userReset={},a.getInfo=function(){return f.get({controller:"info"}).$promise.then(function(b){a.info=b})["catch"](function(a){console.error(a)})},e.bodyLayout="login",a.$on("$viewContentLoaded",function(){Metronic.init(),Layout.init()}),a.reset=function(){b.reset({token:h.token,password:a.userReset.password}).then(function(){i.go("login",{reset:!0})})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("reset",{url:"/reset/:token",templateUrl:"app/reset/reset.html",controller:"ResetCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/login.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("SalesforceListCtrl",["$scope","SalesforceAccount","gridOptions","xAlert","$translate",function(a,b,c,d,e){a.initView=function(){var d={exporterCsvFilename:"salesforce_account.csv",columnDefs:[{name:"name",displayName:"APPLICATION_NAME"},{name:"username"},{name:"remoteUri",displayName:"APPLICATION_URI"},{name:"action",buttons:[{"class":"blue-hoki",href:"/salesforce/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.salesforce.list",{url:"/list",templateUrl:"app/salesforce/list/list.html",controller:"SalesforceListCtrl",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").factory("SalesforceAccount",["$resource",function(a){return a("/api/salesforce/accounts/:id/:controller",{id:"@id"},{update:{method:"PUT"},fields:{params:{controller:"fields"},isArray:!0},check:{params:{controller:"check"}}})}]).factory("SalesforceConfiguration",["$resource",function(a){return a("/api/salesforce/accounts/:accountId/configurations/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]).factory("SalesforceField",["$resource",function(a){return a("/api/salesforce/accounts/:accountId/configurations/:configurationId/fields/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce",{url:"/salesforce",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view.configurations",{url:"/configurations",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewConfigurationListCtrl",["$scope","$stateParams","$translate","gridOptions","SalesforceConfiguration","$uibModal",function(a,b,c,d,e,f){a.initView=function(){var c={exporterCsvFilename:"salesforce_configurations.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:125,buttons:[{"class":"blue-hoki",href:"/salesforce/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/salesforce/view/configuration/list/create.modal.html",controller:"SalesforceCreateConfigurationCtrl"});b.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SalesforceCreateConfigurationCtrl",["$scope","$translate","$uibModalInstance","SalesforceConfiguration","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.salesforce.view.configurations.list",{url:"/list",templateUrl:"app/salesforce/view/configuration/list/list.html",controller:"SalesforceViewConfigurationListCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewConfigurationViewCtrl",["$scope","$filter","$stateParams","$translate","socket","variable","xAlert","SalesforceAccount","SalesforceConfiguration","SalesforceField","Variable",function(a,b,c,d,e,f,g,h,i,j,k){a.$on("$destroy",function(){e.unsyncUpdates("salesforce_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";default:
+return"Other"}},a.initView=function(){a.configurationName="",a.subjectConfig=[],a.descriptionConfig=[],a.fieldConfig=[],a.variables=f},a.getConfiguration=function(){return i.get({accountId:c.id,id:c.configurationId}).$promise.then(function(b){a.configurationName=b.name,a.subjectConfig=b.Subject,a.descriptionConfig=b.Description,a.fieldConfig=b.Field,e.socket.on("salesforce_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 k.get().$promise.then(function(b){a.customVariables=b.rows})["catch"](function(a){g.error(a)})},a.getFields=function(){return h.fields({id:c.id}).$promise.then(function(c){a.accountFields=_.sortByOrder(b("salesforce")(c),"name","asc"),console.log(a.accountFields)})["catch"](function(a){g.error(a)})},a.addItem=function(b){var d={};switch(b){case"subject":case"description":d={type:"string",content:""};break;case"field":d={content:""}}return i.save({accountId:c.id,id:c.configurationId,controller:b},d).$promise.then(function(c){switch(b){case"subject":a.subjectConfig.push(c);break;case"description":a.descriptionConfig.push(c);break;case"field":a.fieldConfig.push(c)}})["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 j.update({accountId:c.id,configurationId:c.configurationId,id:a.id},a).$promise.then(function(){})["catch"](function(a){g.error(a)})},a.removeItem=function(a){return j["delete"]({accountId:c.id,configurationId:c.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.getSystemFieldOptions=function(b){if(b){var c=_.find(a.accountFields,"name",b);if(c)switch(c.type){case"picklist":return c.picklistValues;default:return}}}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view.configurations.view",{url:"/view/:configurationId",templateUrl:"app/salesforce/view/configuration/view/view.html",controller:"SalesforceViewConfigurationViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("SalesforceViewCtrl",["$scope","$http","$stateParams","$translate","$location","WizardHandler","socket","xAlert","Modal","$filter","SalesforceAccount",function(a,b,c,d,e,f,g,h,i,j,k){a.initView=function(){return k.get({id:c.id}).$promise.then(function(b){a.account=b})["catch"](function(a){h.error(a)})},a.updateItem=function(){return k.update({id:c.id},a.account).$promise.then(function(){h.show(d.instant("MESSAGE_WELL_DONE")+".","success")})["catch"](function(a){h.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.view",{url:"/view/:id",templateUrl:"app/salesforce/view/view.html",controller:"SalesforceViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}}).state("main.salesforce.view.account",{url:"/account",templateUrl:"app/salesforce/view/view.account.html"})}]),angular.module("xCallyShuttleApp").controller("SalesforceWizardCtrl",["$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.item.serverUrl=c.protocol()+"://"+location.host},a.next=function(){f.wizard().next()},a.exitValidation=function(a){return a},a.createItem=function(){console.log(a.item),b.post("api/salesforce/accounts",a.item).success(function(){e.show(d.instant("MESSAGE_WELL_DONE")+".","success"),c.path("/salesforce/list")}).error(function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.salesforce.wizard",{url:"/wizard",templateUrl:"app/salesforce/wizard/wizard.html",controller:"SalesforceWizardCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization",{url:"/customization",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("CustomizationGeneralViewCtrl",["$scope","gridOptions","$uibModal","FileUploader","$cookieStore","xAlert","$translate","Setting","$rootScope",function(a,b,c,d,e,f,g,h,i){a.radioSwitch={isActive:i.license.custom?!0:!1,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"};var j=a.uploader=new d({url:"api/settings/logo/main",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});j.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),j.onSuccessItem=function(a,b){i.settings.logo=b.logo,f.show(g.instant("MESSAGE_WELL_DONE"),"success")},j.onErrorItem=function(){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},j.onCompleteAll=function(){j.clearQueue()};var k=a.uploader2=new d({url:"api/settings/logo/login",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+e.get("token")}});k.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),k.onSuccessItem=function(a,b){f.show(g.instant("MESSAGE_WELL_DONE"),"success")},k.onErrorItem=function(){f.show(g.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},k.onCompleteAll=function(){k.clearQueue()},a.initView=function(){return h.get({id:1}).$promise.then(function(b){a.settings={defaultLogo:b.defaultLogo,defaultLoginLogo:b.defaultLoginLogo,footerWhiteLabel:b.footerWhiteLabel,defaultFooterWhiteLabel:b.defaultFooterWhiteLabel}})["catch"](function(a){f.error(a)})},a.update=function(){return h.update({id:1},a.settings).$promise.then(function(b){_.merge(i.settings,a.settings),f.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization.view.general",{url:"/general",templateUrl:"app/setting/customization/view/general/general.html",controller:"CustomizationGeneralViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}})}]),angular.module("xCallyShuttleApp").controller("CustomizationViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.customization.view",{url:"/view",templateUrl:"app/setting/customization/view/view.html",controller:"CustomizationViewCtrl",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"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general",{url:"/general",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("GeneralMainViewCtrl",["$scope","xAlert","$translate","Setting",function(a,b,c,d){a.initView=function(){return d.get({id:1}).$promise.then(function(b){a.settings={agi_port:b.agi_port,min_internal:b.min_internal,min_mailbox:b.min_mailbox,securePassword:b.securePassword}})["catch"](function(a){b.error(a)})},a.update=function(){return d.update({id:1},a.settings).$promise.then(function(a){b.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){b.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general.view.main",{url:"/main",templateUrl:"app/setting/general/view/main/main.html",controller:"GeneralMainViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("GeneralViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.general.view",{url:"/view",templateUrl:"app/setting/general/view/view.html",controller:"GeneralViewCtrl"})}]),angular.module("xCallyShuttleApp").factory("License",["$resource",function(a){return a("/api/licenses/:id/:controller",{id:"@id"},{request:{method:"POST",params:{id:"request"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license",{url:"/license",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("LicenseUpdateCtrl",["$scope","$translate","$uibModalInstance","xAlert","Setting",function(a,b,c,d,e){a.form={},a.item={},a.getLicense=function(){return e.get({id:1}).$promise.then(function(b){a.item.license=b.license})["catch"](function(a){d.error(a)})},a.update=function(){return e.update({id:1},a.item).$promise.then(function(a){d.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){d.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").controller("LicenseViewCtrl",["$scope","$rootScope","$translate","License","xAlert","$window","$uibModal",function(a,b,c,d,e,f,g){a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.initView=function(){return d.get(function(b){a.item=b.license})},a.submitRequest=function(){return d.request(a.item,function(){e.show(c.instant("MESSAGE_WELL_DONE"),"success")},function(a){switch(a.status){case 304:e.show(a.statusText,"info");break;default:e.error(a)}})},a.updateLicense=function(){var a=g.open({animation:!0,templateUrl:"app/setting/license/view/update.modal.html",controller:"LicenseUpdateCtrl"});a.result.then(function(){f.location.reload()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.license.view",{url:"/view",templateUrl:"app/setting/license/view/view.html",controller:"LicenseViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/pricing-tables.css"]}])}]}})}]),angular.module("xCallyShuttleApp").factory("Externip",["$resource",function(a){return a("/api/network/externips/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Localnet",["$resource",function(a){return a("/api/network/localnets/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network",{url:"/network",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("ExternipCtrl",["$scope","$uibModal","gridOptions","Externip",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"network_externip.csv",columnDefs:[{name:"value"},{name:"action",buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(d,b,a)},a.createItem=function(c){var d=b.open({animation:!0,templateUrl:"app/setting/network/view/externip/externip.create.modal.html",controller:"ExternipCreateCtrl",resolve:{item:c}});d.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("ExternipCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","Externip","xAlert","item",function(a,b,c,d,e,f,g){a.initModal=function(){a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_EXTERNIP"):b.instant("APPLICATION_NEW_EXTERNIP")},a.save=function(){return g?e.update({id:a.item.id},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)}):e.save({},a.item).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view.externip",{url:"/externip",templateUrl:"app/setting/network/view/externip/externip.html",controller:"ExternipCtrl"})}]),angular.module("xCallyShuttleApp").controller("LocalnetCtrl",["$scope","gridOptions","Localnet","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"network_localnet.csv",columnDefs:[{name:"value"},{name:"action",buttons:[{"class":"blue-hoki",onClick:"grid.appScope.createItem(row.entity)",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=b.gridOptions(c,d,a)},a.createItem=function(b){var c=d.open({animation:!0,templateUrl:"app/setting/network/view/localnet/localnet.create.modal.html",controller:"LocalnetCreateCtrl",resolve:{item:b}});c.result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("LocalnetCreateCtrl",["$scope","$translate","$uibModalInstance","$stateParams","Localnet","xAlert","item",function(a,b,c,d,e,f,g){a.initModal=function(){if(a.form={},a.item=g||{},a.title=g?b.instant("APPLICATION_EDIT_LOCALNET"):b.instant("APPLICATION_NEW_LOCALNET"),g&&g.value){var c=a.item.value.split("/");c.length>1&&(a.item.address=c[0],a.item.mask=c[1])}},a.save=function(){var d=a.item.address+"/"+a.item.mask;return g?e.update({id:a.item.id},{value:d}).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)}):e.save({},{value:d}).$promise.then(function(a){f.show(b.instant("MESSAGE_WELL_DONE"),"success"),c.close(a)})["catch"](function(a){f.error(a)})},a.cancel=function(){c.dismiss()}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view.localnet",{url:"/localnet",templateUrl:"app/setting/network/view/localnet/localnet.html",controller:"LocalnetCtrl"})}]),angular.module("xCallyShuttleApp").controller("NetworkViewCtrl",function(){}),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.network.view",{url:"/view",templateUrl:"app/setting/network/view/view.html",controller:"NetworkViewCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting",{url:"/setting",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:18}}})}]),angular.module("xCallyShuttleApp").factory("Setting",["$resource",function(a){return a("/api/settings/:id/:controller/:param",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("Smtp",["$resource",function(a){return a("/api/mail/servers/out/:id/:controller/:controller2",{id:"@id"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp",{url:"/smtp",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SmtpViewCtrl",["$scope","$stateParams","$translate","socket","MailServerOut","Setting","MailAccount","xAlert",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.smtpDisabled=!1,a.isActive=!0,a.size="small",a.animate=!0,a.radioOff=!0,a.handleWidth="auto",a.labelWidth="auto",a.inverse=!0,a.offColor="danger",a.onColor="success",a.CONST_TIMEOUT=3e4,a.item={account:{service:!0,MailServerOut:{ssl:!1}}},f.get({id:"smtp"}).$promise.then(function(b){a.item.account=b,d.socket.on("mail_server_out:state",function(b){Number(b.id)===a.item.account.MailServerOut.id&&(a.item.account.MailServerOut.state=b.state,a.item.account.MailServerOut.source=JSON.parse(b.source))})})["catch"](function(b){switch(console.log(b),b.status){case 404:a.item.account.name=null,a.item.account.address=null,a.item.account.MailServerOut={ssl:!1},h.show("Service SMTP server not configured.","info");break;default:h.error(b)}})},a.updateItem=function(){return a.item.account.id?(delete a.item.account.MailServerOut.state,delete a.item.account.MailServerOut.source,f.update({id:"smtp",controller:a.item.account.id},a.item.account).$promise.then(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})):f.save({id:"smtp"},{description:"Custom Account",name:a.item.account.name,address:a.item.account.address,service:a.item.account.service,custom:!0,MailServerOut:a.item.account.MailServerOut}).$promise.then(function(){h.show(c.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){h.error(a)})},a.test=function(){return e.get({id:a.item.account.MailServerOut.id,controller:"test"}).$promise["catch"](function(a){console.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.smtp.view",{url:"/view",templateUrl:"app/setting/smtp/view/view.html",controller:"SmtpViewCtrl",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"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system",{url:"/system",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("SystemViewConsoleCtrl",["$scope","Setting","xAlert","usSpinnerService","$timeout","$translate",function(a,b,c,d,e,f){function g(b){var c=_.findIndex(a.commandHistory.commands,function(a){return a===b});-1!==c&&a.commandHistory.commands.splice(c,1),a.commandHistory.commands.unshift(b)}a.output="<b>"+f.instant("APPLICATION_CONSOLE_WELCOME")+"</b><br/>",a.item={command:""},a.commandHistory={commands:[],index:-1},a.busy=!1,a.cmdFocus=function(){e(function(){angular.element("#command").trigger("focus")})},a.sendCmd=function(){return a.commandHistory.index=-1,a.tmp=a.item.command,a.item.command="",a.output+="<b>motion*CLI> "+a.tmp+"</b><br>",a.tmp?(g(a.tmp.trim()),a.busy=!0,d.spin("console-spinner"),b.save({controller:"asterisk"},{command:a.tmp}).$promise.then(function(b){a.output+=b.content.replace(/(?:\r\n|\r|\n)/g,"<br />").replace("Response: Follows<br />Privilege: Command<br />","").replace(/ActionID: .[0-9]*<br \/>/,"").replace(/ActionID: .[0-9]*/,"")+"<br>",d.stop("console-spinner"),a.busy=!1,a.cmdFocus()})["catch"](function(b){d.stop("console-spinner"),a.output+="command error:"+b.data.message+"<br>",a.busy=!1,a.cmdFocus()})):void 0},a.keyUp=function(b){switch(b.keyCode){case 40:a.commandHistory.commands[a.commandHistory.index-1]?a.item.command=a.commandHistory.commands[--a.commandHistory.index]:(a.item.command="",a.commandHistory.index=-1);break;case 38:a.commandHistory.commands[a.commandHistory.index+1]&&(a.item.command=a.commandHistory.commands[++a.commandHistory.index]);break;case 37:break;case 39:break;default:a.commandHistory.index=-1}},e(function(){angular.element("#command").trigger("focus"),d.stop("console-spinner")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.console",{url:"/console",templateUrl:"app/setting/system/view/console/console.html",controller:"SystemViewConsoleCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewGeneralCtrl",["$scope","$stateParams","$translate","socket","Setting","xAlert","usSpinnerService",function(a,b,c,d,e,f,g){function h(b){a.system.memory={labels:_.keys(b.memory.details),values:_.values(_.map(b.memory.details,function(a){return Math.round(a/1024)})),Total:Math.round(b.memory.Total/1024)},g.stop("memory-spinner"),a.system.disks=[],_.forEach(b.disks,function(b){a.system.disks.push({mount:b.mount,size:Number((b.size/1048576).toFixed(2)),values:_.values(_.map(b.details,function(a){return Number((a/1048576).toFixed(2))})),labels:_.keys(b.details)})}),a.system.mount=a.system.disks[0],g.stop("disk-spinner"),a.system.cpu={motion:Math.round(b.cpu.motion),cores:[]},_.forEach(b.cpu.cores,function(b){delete b.nice,delete b.irq,a.system.cpu.cores.push({labels:_.keys(b),values:_.values(b),colours:["#803690","#DCDCDC","#00ADF9"]})}),g.stop("cpu-spinner")}a.system={mount:void 0},a.initView=function(){return g.spin("memory-spinner"),g.spin("disk-spinner"),g.spin("cpu-spinner"),e.get({controller:"system"}).$promise.then(function(a){h(a)})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.general",{url:"/general",templateUrl:"app/setting/system/view/general/general.html",controller:"SystemViewGeneralCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewLogsCtrl",["$scope","$stateParams","$translate","socket","Setting","xAlert","usSpinnerService",function(a,b,c,d,e,f,g){a.initView=function(){return a.logs={errors:"",output:""},g.spin("logs-spinner"),e.get({controller:"logs"}).$promise.then(function(b){a.logs=b,g.stop("logs-spinner")})["catch"](function(a){f.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view.logs",{url:"/logs",templateUrl:"app/setting/system/view/logs/logs.html",controller:"SystemViewLogsCtrl"})}]),angular.module("xCallyShuttleApp").controller("SystemViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.system.view",{url:"/view",templateUrl:"app/setting/system/view/view.html",controller:"SystemViewCtrl"})}]),angular.module("xCallyShuttleApp").controller("UpdateListCtrl",["$scope","gridOptions","$uibModal","$location","Update",function(a,b,c,d,e){a.initCounter=function(){a.$on("timer-stopped",function(a,b){console.log("Timer Stopped - data = ",b),d.path("/dashboard/voice")})},a.initView=function(){var c={exporterCsvFilename:"updates.csv",enableFiltering:!1,enableSorting:!1,enablePaginationControls:!1,enableSelectAll:!1,columnDefs:[{name:"message"},{width:125,name:"version",cellClass:"text-center ui-grid-vcenter"},{width:125,name:"createdAt",displayName:"APPLICATION_UPDATED_AT",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><span am-time-ago="row.entity.createdAt"></span></div>'}]};a.gridOptions=b.gridOptions(e,c,a)},a.pull=function(){c.open({animation:!0,templateUrl:"app/setting/update/list/list.pull.html",controller:"UpdateListPullCtrl"})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates.list",{url:"/list",templateUrl:"app/setting/update/list/list.html",controller:"UpdateListCtrl"}).state("main.setting.updates.landing",{url:"/landing",templateUrl:"app/setting/update/list/landing.html",controller:"UpdateListCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{name:"smart-table",insertBefore:"#ng_load_plugins_before",files:["assets/css/error.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("UpdateListPullCtrl",["$scope","$uibModalInstance","$translate","$location","Update",function(a,b,c,d,e){a.modal={dismissable:!0,title:"Confirm Checkout",html:"Are you sure you want to checkout?",buttons:[{classes:"btn btn-success",text:"Checkout",click:function(){return e.pull().$promise["finally"](function(){b.dismiss("close"),d.path("/setting/updates/landing")})}},{classes:"btn default",text:"Cancel",click:function(){b.dismiss("cancel")}}]}}]),angular.module("xCallyShuttleApp").factory("Update",["$resource",function(a){return a("/api/updates/:id/:controller",{id:"@id"},{pull:{method:"GET",params:{id:"pull"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.setting.updates",{url:"/updates",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["hasUpdate"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCtrl",["$scope","$uibModal","$translate","SquareOdbc","gridOptions","xAlert",function(a,b,c,d,e,f){a.initView=function(){var b={exporterCsvFilename:"odbc.csv",columnDefs:[{name:"name"},{name:"dsn",displayName:"APPLICATION_ODBC"},{name:"description"},{name:"action",width:250,buttons:[{"class":"blue-hoki",href:"/square/odbc/view/{{row.entity.id}}/settings",name:"settings"},{"class":"green-jungle",name:"check",onClick:"grid.appScope.checkConnection(row.entity.id)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(d,b,a)},a.createItem=function(){var c=b.open({animation:!0,templateUrl:"app/square/odbc/list/list.create.modal.html",controller:"SquareOdbcListCreateCtrl"});c.result.then(function(){a.gridOptions.getPage()})},a.checkConnection=function(a){return d.get({id:a,controller:"check"}).$promise.then(function(){f.show(c.instant("MESSAGE_CONNECTION_VERIFIED"),"success")})["catch"](function(){f.show(c.instant("MESSAGE_CONNECTION_INVALID"),"danger")})}}]),angular.module("xCallyShuttleApp").controller("SquareOdbcListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareOdbc","xAlert",function(a,b,c,d,e){a.form={},a.item={},a.item.dsn||(a.item.dsn="DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion"),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.square.odbc.list",{url:"/list",templateUrl:"app/square/odbc/list/list.html",controller:"SquareOdbcListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc",{url:"/odbc",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareOdbc",["$resource",function(a){return a("/api/square/odbc/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareOdbcViewCtrl",["$scope","$translate","$stateParams","SquareOdbc","xAlert",function(a,b,c,d,e){a.odbc={},a.getOdbc=function(){return d.get({id:c.id}).$promise.then(function(b){a.odbc=b})["catch"](function(a){e.error(a)})},a.updateOdbc=function(){var f=angular.copy(a.odbc);return d.update({id:c.id},f).$promise.then(function(){e.show(b.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.odbc.view",{url:"/view/:id",templateUrl:"app/square/odbc/view/view.html",controller:"SquareOdbcViewCtrl",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.square.odbc.view.settings",{url:"/settings",templateUrl:"app/square/odbc/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCtrl",["$scope","$uibModal","SquareProject","gridOptions",function(a,b,c,d){a.initView=function(){var b={exporterCsvFilename:"projects.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:160,buttons:[{"class":"blue-hoki",href:"/square/projects/view/{{row.entity.id}}",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/square/project/list/list.create.modal.html",controller:"SquareProjectListCreateCtrl"});c.result.then(function(b){console.log(b),a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").controller("SquareProjectListCreateCtrl",["$scope","$translate","$uibModalInstance","SquareProject","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.square.projects.list",{url:"/list",templateUrl:"app/square/project/list/list.html",controller:"SquareProjectListCtrl",authenticate:!0})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects",{url:"/projects",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareProject",["$resource",function(a){return a("/api/square/projects/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareProjectViewCtrl",["$scope","$stateParams","Auth","xAlert","SquareProject","socket","$translate","$log","$uibModal",function(a,b,c,d,e,f,g,h,i){a.squareProject={},a.$on("$destroy",function(){f.unsyncUpdates("square_project")}),a.getProject=function(){return e.get({id:b.id}).$promise.then(function(b){a.squareProject=b,angular.element(document).ready(function(){window.onerror=function(a,b,c){try{if(null!==a&&-1!==a.indexOf("Script error."));else{var e=new Image;e.src="assets/plugins/mxgraph/images/1x1.png?msg="+encodeURIComponent(a)+"&url="+encodeURIComponent(b)+"&lnum="+encodeURIComponent(c)}}catch(f){d.error(f)}},b.token=c.getToken();var a=new EditorUi(new Editor);a.openString(b.preproduction,b.name,b),a.editor.graphChangeListener=function(a,b){var c=b.properties.rtChange||!1;c||(this.modified=!0)}}),f.socket.on("square_project:save",function(c){c.id===b.id&&(a.squareProject=_.merge(a.squareProject,c))})})["catch"](function(a){d.error(a)})},a.editNotes=function(){var c=i.open({animation:!0,templateUrl:"app/square/project/view/projectNotes.modal.html",controller:["$scope","$uibModalInstance","notes",function(a,b,c){a.notes=c,a.close=function(){b.close(a.notes)},a.cancel=function(){b.dismiss("cancel")}}],resolve:{notes:{value:a.squareProject.notes}}});c.result.then(function(a){return e.update({id:b.id},{notes:a.value}).$promise.then(function(){d.show(g.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){d.error(a)})},function(){h.info("Modal dismissed at: "+new Date)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.projects.view",{url:"/view/:id",templateUrl:"app/square/project/view/view.html",controller:"SquareProjectViewCtrl",authenticate:!0,resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",serie:!0,cache:!1,files:["assets/plugins/mxgraph/css/common.css","assets/plugins/mxgraph/css/explorer.css","assets/plugins/mxgraph/styles/grapheditor.css","assets/plugins/mxgraph/styles/custom.css","assets/plugins/square/js/custom.js","assets/plugins/mxgraph/js/mxClient.js","assets/plugins/square/js/Editor.js","assets/plugins/square/js/Graph.js","assets/plugins/square/js/EditorUi.js","assets/plugins/square/js/Actions.js","assets/plugins/square/js/Menus.js","assets/plugins/square/js/Sidebar.js","assets/plugins/square/js/Toolbar.js","assets/plugins/square/js/Dialogs.js"]}])}]}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime",{url:"/realtime",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:14}}})}]),angular.module("xCallyShuttleApp").factory("ReportSquare",["$resource",function(a){return a("/api/report/square/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("ReportSquareDetail",["$resource",function(a){
+return a("/api/report/square/details/:id/:controller",{name:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").controller("SquareRealtimeViewGeneralCtrl",["$scope","$log","$uibModal","$translate","socket","xAlert","ReportSquare","usSpinnerService","$q","uiGridConstants",function(a,b,c,d,e,f,g,h,i,j){function k(b){return h.spin("spinner-grid"),g.get(m).$promise.then(function(b){a.gridOptions.totalItems=b.count,a.gridOptions.data=b.rows})["catch"](function(a){f.error(a)})["finally"](function(){b&&l(),h.stop("spinner-grid")})}function l(){e.socket.on("report_square:save",function(b){if(b.leaveAt){var c=_.remove(a.gridOptions.data,{id:b.id});c&&k()}else{var d=_.find(a.gridOptions.data,{id:b.id});if(!d&&a.gridOptions.data.length<m.limit){var e=_.clone(m);if(_.forEach(["offset","limit","controller","order"],function(a){delete e[a]}),_.isEmpty(e))a.gridOptions.data.push(b);else{var f=!0;_.forOwn(e,function(a,c){_.includes(b[c],a)||(f=!1)}),f&&a.gridOptions.data.push(b)}}}})}var m={controller:"realtime",offset:0,limit:25};a.moment=moment,a.init=function(){a.gridOptions={enableGridMenu:!0,headerCellFilter:"translate",enableHorizontalScrollbar:0,enableVerticalScrollbar:0,enableFiltering:!0,showGridFooter:!0,paginationPageSizes:[10,25,50,75],paginationPageSize:25,useExternalPagination:!0,useExternalSorting:!0,useExternalFiltering:!0,showTreeExpandNoChildren:!0,columnDefs:[{name:"uniqueid"},{name:"callerid"},{name:"extension"},{name:"project_name",displayName:"APPLICATION_PROJECT",headerCellFilter:"translate"},{name:"joinAt",displayName:"APPLICATION_ELAPSED_TIME",headerCellFilter:"translate",cellClass:"text-center ui-grid-vcenter",cellTemplate:'<div><timer start-time="grid.appScope.moment(row.entity.joinAt).unix()*1000">{{hhours}}:{{mminutes}}:{{sseconds}}</timer></div>',enableSorting:!1,enableColumnMenu:!1,enableFiltering:!1}],data:[],gridMenuTitleFilter:function(a){var b=i.defer();return b.resolve(d.instant(a)),b.promise},onRegisterApi:function(b){a.gridApi=b,a.gridApi.grid.registerDataChangeCallback(function(){n(a.gridApi.core.getVisibleRows(a.gridApi.grid).length)}),a.gridApi.core.on.sortChanged(a,function(a,b){0===b.length?m.order=null:m.order=b[0].name+" "+b[0].sort.direction.toUpperCase(),k()}),a.gridApi.pagination.on.paginationChanged(a,function(a,b){m.offset=(a-1)*b,m.limit=b,k()}),a.gridApi.core.on.filterChanged(a,function(){var a=this.grid;a.columns.forEach(function(a){a.filters[0].term?m[a.name]=a.filters[0].term:delete m[a.name]}),k()})}},k(!0)};var n=function(a){var b=a?30*a+130:270;angular.element(document.getElementsByClassName("ui-grid")[0]).css("height",b+"px"),angular.element(document.getElementsByClassName("ui-grid-viewport")).css("height",30*a+"px")};a.$on("$destroy",function(){e.unsyncUpdates("report_square")})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime.view.general",{url:"/general",templateUrl:"app/square/realtime/view/general/general.html",controller:"SquareRealtimeViewGeneralCtrl"})}]),angular.module("xCallyShuttleApp").controller("SquareRealtimeViewCtrl",["$scope",function(a){}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.realtime.view",{url:"/view",templateUrl:"app/square/realtime/view/view.html",controller:"SquareRealtimeViewCtrl",resolve:{deps:["$ocLazyLoad",function(a){return a.load([{insertBefore:"#ng_load_plugins_before",files:["assets/css/profile.css","assets/css/tasks.css"]}])}]}})}]),angular.module("xCallyShuttleApp").controller("SquareRecordingListCtrl",["$scope","SquareRecording","gridOptions",function(a,b,c){a.SquareRecording=b;a.initView=function(){var d={exporterCsvFilename:"recordings.csv",rowHeight:30,columnDefs:[{name:"uniqueid"},{name:"callerid",displayName:"APPLICATION_CALLERIDNUM"},{name:"filename"},{name:"extension"},{name:"projectName",displayName:"APPLICATION_PROJECT"},{name:"audio",displayName:"",width:100,enableSorting:!1,enableFiltering:!1,cellClass:"ui-grid-vcenter",cellTemplate:"<div><audio-file-download data-ng-if=\"row.entity.savePath.split('.').pop() == 'wav'\" params=\"{id:row.entity.id,controller:'stream'}\" resource=\"grid.appScope.SquareRecording\"></audio-file-download><span data-ng-if=\"row.entity.value.split('.').pop() == 'gsm'\" title=\"{{'MESSAGE_GSM_PREVIEW_NOT_SUPPORTED' | translate}}\">{{'MESSAGE_GSM_PREVIEW_NOT_SUPPORTED' | translate}}</span></div>"},{name:"action",width:80,buttons:[{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.filename || row.entity.uniqueid, row.entity.id)"},{directive:'<motion-file-download params="{id:row.entity.id,controller:\'stream\'}" resource="grid.appScope.SquareRecording" mimetype="audio/wav" btnclass="btn btn-xs blue-hoki" filename="(row.entity.filename || row.entity.uniqueid)+\'.wav\'"></motion-file-download>'}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.recordings.list",{url:"/list",templateUrl:"app/square/recording/list/list.html",controller:"SquareRecordingListCtrl"})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square.recordings",{url:"/recordings",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").factory("SquareRecording",["$resource",function(a){return a("/api/square/recordings/:id/:controller",{id:"@id"},{update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.square",{url:"/square",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user"],redirectTo:"landing",id:14}}})}]),angular.module("xCallyShuttleApp").factory("Agent",["$resource",function(a){return a("/api/agents/:id/:controller/:controller1/:controller2/:controller3",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},patch:{method:"PATCH"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents",{url:"/agents",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}})}]),angular.module("xCallyShuttleApp").controller("AgentListCtrl",["$scope","$timeout","Agent","Auth","gridOptions",function(a,b,c,d,e){a.initView=function(){a.Auth=d;var b={exporterCsvFilename:"agents.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/staff/agents/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-meadow",href:"/staff/agents/view/{{row.entity.id}}/queues/voice",name:"queues"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(c,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.list",{url:"/list",templateUrl:"app/staff/agent/list/list.html",controller:"AgentListCtrl",data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}})}]),angular.module("xCallyShuttleApp").controller("AgentViewCtrl",["$scope","$http","xAlert","$translate","$stateParams","$cookieStore","Agent","FileUploader","Auth","MailQueue","User","VoiceQueue","ChatQueue","FaxQueue","SmsQueue","OpenChannelQueue","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){a.Auth=i,a.radioSwitch={isActive:!0,size:"small",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},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.initVoiceQueues=function(){var a={},b={};return l.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{name:a.name}}),g.get({id:e.id,controller:"voice",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"voice",e.id,g)})["catch"](function(a){console.error(a)})},a.initChatQueues=function(){var a={},b={};return m.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"chat",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"chat",e.id,g)})["catch"](function(a){console.error(a)})},a.initMailQueues=function(){var a={},b={};return j.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"mail",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"mail",e.id,g)})["catch"](function(a){console.error(a)})},a.initSmsQueues=function(){var a={},b={};return o.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"sms",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"sms",e.id,g)})["catch"](function(a){console.error(a)})},a.initFaxQueues=function(){var a={},b={};return n.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"fax",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"fax",e.id,g)})["catch"](function(a){console.error(a)})},a.initOpenchannelQueues=function(){var a={},b={};return p.get().$promise.then(function(b){return a.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}}),g.get({id:e.id,controller:"openchannel",controller2:"queues"}).$promise}).then(function(a){b.queues=_.map(a.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a,b,"openchannel",e.id,g)})["catch"](function(a){console.error(a)})},a.updatePassword=function(){var b={newPassword:a.agent.newPwd};return i.isAdmin()?b.id=e.id:b.oldPassword=a.agent.currentPwd,k.changePassword(b).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})};var r=a.uploader=new h({url:"api/users/"+e.id+"/avatar",queueLimit:1,withCredentials:!0,headers:{Authorization:"Bearer "+f.get("token")}});r.filters.push({name:"imageFilter",fn:function(a){var b="|"+a.type.slice(a.type.lastIndexOf("/")+1)+"|";return-1!=="|jpg|png|jpeg|".indexOf(b)}}),r.onSuccessItem=function(b,e){a.agent.userpic=e.userpic,a.agent.id===i.getCurrentUser().id&&(i.getCurrentUser().userpic=e.userpic),c.show(d.instant("MESSAGE_WELL_DONE"),"success")},r.onErrorItem=function(){c.show(d.instant("MESSAGE_SOMETHING_WENT_WRONG"),"danger")},r.onCompleteAll=function(){r.clearQueue()},a.initView=function(){return g.get({id:e.id}).$promise.then(function(b){return a.agent=b,a.agent.transport=a.agent.transport?a.agent.transport.split(","):[],a.agent.allow=a.agent.allow?a.agent.allow.split(";"):[],a.agent.nat=a.agent.nat?a.agent.nat.split(","):[],q.get({id:1}).$promise}).then(function(b){a.setting=b})["catch"](function(a){c.error(a)})},a.patchItem=function(){return g.update({id:e.id},{chatCapacity:a.agent.chatCapacity,mailCapacity:a.agent.mailCapacity,faxCapacity:a.agent.faxCapacity,smsCapacity:a.agent.smsCapacity,openchannelCapacity:a.agent.openchannelCapacity}).$promise.then(function(){c.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){c.error(a)})},a.updateItem=function(){var b=angular.copy(a.agent);return delete b.password,delete b.md5secret,b.transport=b.transport.join(","),b.allow=b.allow.join(";"),b.nat=b.nat.join(","),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.staff.agents.view",{url:"/view/:id",templateUrl:"app/staff/agent/view/view.html",controller:"AgentViewCtrl",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"]}])}]},data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.account",{url:"/account",templateUrl:"app/staff/agent/view/view.account.html",data:{permissions:{only:["admin","user","agent"],redirectTo:"landing",id:4}},resolve:{deps:["$ocLazyLoad",function(a){return a.load({insertBefore:"#ng_load_plugins_before",files:["assets/scripts/jquery.sparkline.min.js","assets/plugins/bootstrap-fileinput/bootstrap-fileinput.js","assets/scripts/profile.js"]})}]}}).state("main.staff.agents.view.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.voice.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.chat.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.mail.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.fax.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.sms",{url:"/sms",templateUrl:"app/staff/agent/view/view.sms.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.openchannel",{url:"/openchannel",templateUrl:"app/staff/agent/view/view.openchannel.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.motionbar",{url:"/motionbar",templateUrl:"app/staff/agent/view/view.motionbar.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}}}).state("main.staff.agents.view.queues",{url:"/queues",templateUrl:"app/staff/agent/view/view.queues.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:4}},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.agents.view.queues.voice",{url:"/voice",templateUrl:"app/staff/agent/view/view.queues.voice.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:7}}}).state("main.staff.agents.view.queues.chat",{url:"/chat",templateUrl:"app/staff/agent/view/view.queues.chat.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:8}}}).state("main.staff.agents.view.queues.mail",{url:"/mail",templateUrl:"app/staff/agent/view/view.queues.mail.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:9}}}).state("main.staff.agents.view.queues.fax",{url:"/fax",templateUrl:"app/staff/agent/view/view.queues.fax.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:10}}}).state("main.staff.agents.view.queues.sms",{url:"/sms",templateUrl:"app/staff/agent/view/view.queues.sms.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:11}}}).state("main.staff.agents.view.queues.openchannel",{url:"/openchannel",templateUrl:"app/staff/agent/view/view.queues.openchannel.html",data:{permissions:{only:["admin","user"],redirectTo:"landing",id:20}}})}]),angular.module("xCallyShuttleApp").controller("AgentWizardCtrl",["$scope","$rootScope","$location","$translate","$http","Agent","VoiceQueue","ChatQueue","MailQueue","SmsQueue","FaxQueue","OpenChannelQueue","Setting","xAlert","WizardHandler",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a.maxAmount=1e3,a._data={voice:{queues:[]},chat:{queues:[]},mail:{queues:[]},sms:{queues:[]},fax:{queues:[]},openchannel:{queues:[]}},a._agent=angular.copy(a._data),a.initVoiceQueues=function(){return g.get().$promise.then(function(b){a._data.voice.queues=_.map(b.rows,function(a){return{name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.voice,a._agent.voice,"voice",null,null)})["catch"](function(a){console.error(a)})},a.initChatQueues=function(){return h.get().$promise.then(function(b){a._data.chat.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.chat,a._agent.chat,"chat",null,null)})["catch"](function(a){console.error(a)})},a.initMailQueues=function(){return i.get().$promise.then(function(b){a._data.mail.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.mail,a._agent.mail,"mail",null,null)})["catch"](function(a){console.error(a)})},a.initSmsQueues=function(){return j.get().$promise.then(function(b){a._data.sms.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.sms,a._agent.sms,"sms",null,null)})["catch"](function(a){console.error(a)})},a.initFaxQueues=function(){return k.get().$promise.then(function(b){a._data.fax.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.fax,a._agent.fax,"fax",null,null)})["catch"](function(a){console.error(a)})},a.initOpenchannelQueues=function(){return l.get().$promise.then(function(b){a._data.openchannel.queues=_.map(b.rows,function(a){return{id:a.id,name:a.name}})}).then(function(){ComponentsDropdowns.bindAgent(a._data.openchannel,a._agent.openchannel,"openchannel",null,null)})["catch"](function(a){console.error(a)})},a.forms={info:void 0,voice:void 0},a.item={role:"agent",allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){o.wizard().next()},a.getAmount=function(){return m.get({controller:"internal",internal:a.item.minInternal}).$promise.then(function(b){a.item.minInternal=Number(b.value),a.maxAmount=b.range||1e3})["catch"](function(a){n.error(a)})},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return m.get({controller:"internal"}).$promise.then(function(b){return a.internal=b,a.item.internal=b.value,a.item.minInternal=b.value,a.maxAmount=b.range||1e3,m.get({id:1}).$promise}).then(function(b){a.setting=b})["catch"](function(a){n.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return delete b.minInternal,b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),b.channels=a._agent,f.save(b).$promise.then(function(){c.path("/staff/agents/list")})["catch"](function(a){console.log(a),n.error(a)})},a.createItems=function(){var b=angular.copy(a.item);return delete b.internal,b.transport&&(b.transport=b.transport.join(",")),b.allow&&(b.allow=b.allow.join(";")),f.save({id:"bulk"},b).$promise.then(function(){c.path("/staff/agents/list")})["catch"](function(a){console.log(a),n.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.agents.wizard",{url:"/wizard",templateUrl:"app/staff/agent/wizard/wizard.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}},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.agents.bulk",{url:"/bulk",templateUrl:"app/staff/agent/wizard/wizard-bulk.html",controller:"AgentWizardCtrl",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff",{url:"/staff",template:"<div ui-view></div>","abstract":!0})}]),angular.module("xCallyShuttleApp").controller("TeamCreateCtrl",["$scope","$uibModalInstance","Team","xAlert",function(a,b,c,d){a.form={},a.item={},a.ok=function(){return c.save(a.item).$promise.then(function(){b.close(a.item)})["catch"](function(a){d.error(a)})},a.cancel=function(){b.dismiss("cancel")}}]),angular.module("xCallyShuttleApp").controller("TeamListCtrl",["$scope","Team","gridOptions","$uibModal",function(a,b,c,d){a.initView=function(){var d={exporterCsvFilename:"teams.csv",columnDefs:[{name:"name"},{name:"description"},{name:"action",width:100,buttons:[{"class":"{{row.entity.defaultEntry ? 'blue-hoki disabled' : 'blue-hoki'}}",href:"/staff/teams/view/{{row.entity.id}}/settings",name:"profile"},{"class":"{{row.entity.defaultEntry ? 'green-turquoise disabled' : 'green-turquoise'}}",name:"agents",href:"/staff/teams/view/{{row.entity.id}}/agents"},{"class":"{{row.entity.defaultEntry ? 'red-sunglo disabled' : 'red-sunglo'}}",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.name, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)},a.createItem=function(){d.open({animation:!0,templateUrl:"app/staff/team/list/create.modal.html",controller:"TeamCreateCtrl"}).result.then(function(){a.gridOptions.getPage()})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.list",{url:"/list",templateUrl:"app/staff/team/list/list.html",controller:"TeamListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Team",["$resource",function(a){return a("/api/teams/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams",{url:"/teams",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("TeamViewCtrl",["$scope","$http","$stateParams","$translate","Team","Agent","xAlert",function(a,b,c,d,e,f,g){var h=function(){return{select:function(b){return console.log("agents",b),e.save({id:a.team.id,controller:"agents"},{agents:b})},deselect:function(b){return e["delete"]({id:a.team.id,controller:"agents",agents:b})}}};a.initView=function(){return e.get({id:c.id}).$promise.then(function(b){a.team=b})["catch"](function(a){g.error(a)})},a.initAgents=function(){return f.get().$promise.then(function(b){return a.agents=b.rows,e.get({id:c.id,controller:"agents"}).$promise}).then(function(b){ComponentsDropdowns.bindTeam(_.map(b.rows,"id"),_.map(a.agents,function(a){return{id:a.id,name:a.name,fullname:a.fullname,internal:a.internal}}),h)})["catch"](function(a){g.error(a)})},a.updateItem=function(){var b=angular.copy(a.team);return e.update({id:c.id},b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.teams.view",{url:"/view/:id",templateUrl:"app/staff/team/view/view.html",controller:"TeamViewCtrl",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.teams.view.agents",{url:"/agents",templateUrl:"app/staff/team/view/view.agents.html",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.teams.view.settings",{url:"/settings",templateUrl:"app/staff/team/view/view.settings.html"})}]),angular.module("xCallyShuttleApp").controller("TelephoneListCtrl",["$scope","Telephone","gridOptions",function(a,b,c){a.initView=function(){var d={exporterCsvFilename:"telephones.csv",columnDefs:[{name:"fullname"},{name:"name"},{name:"internal"},{name:"description"},{name:"action",width:75,buttons:[{"class":"blue-hoki",href:"/staff/telephones/view/{{row.entity.id}}/account",name:"profile"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=c.gridOptions(b,d,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.list",{url:"/list",templateUrl:"app/staff/telephone/list/list.html",controller:"TelephoneListCtrl",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").factory("Telephone",["$resource",function(a){return a("/api/telephones/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones",{url:"/telephones",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneViewCtrl",["$scope","$http","$stateParams","$translate","$cookieStore","Auth","xAlert","Telephone",function(a,b,c,d,e,f,g,h){a.initView=function(){return a.Auth=f,a.forms={},h.get({id:c.id}).$promise.then(function(b){delete b.password,a.item=b,a.item.transport=a.item.transport?a.item.transport.split(","):[],a.item.allow=a.item.allow?a.item.allow.split(";"):[]})["catch"](function(a){g.error(a)})},a.updateItem=function(){var b=angular.copy(a.item);return b.transport=b.transport.join(","),b.allow=b.allow.join(";"),h.update(b).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})},a.updatePassword=function(){return h.update({password:a.item.password}).$promise.then(function(){g.show(d.instant("MESSAGE_WELL_DONE"),"success")})["catch"](function(a){g.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.view",{url:"/view/:id",templateUrl:"app/staff/telephone/view/view.html",controller:"TelephoneViewCtrl",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.telephones.view.account",{url:"/account",templateUrl:"app/staff/telephone/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.telephones.view.voice",{url:"/voice",templateUrl:"app/staff/telephone/view/view.voice.html",data:{permissions:{only:["admin"],redirectTo:"main.dashboard.voice"}}})}]),angular.module("xCallyShuttleApp").controller("TelephoneWizardCtrl",["$scope","$http","$location","WizardHandler","xAlert","$translate","Telephone","Setting",function(a,b,c,d,e,f,g,h){a.forms={},a.item={allow:["alaw","ulaw","gsm"],transport:["udp"],context:"from-sip"},a.next=function(){d.wizard().next()},a.exitValidation=function(a){return a},a.getFirstFreeInternal=function(){return h.get({controller:"internal"}).$promise.then(function(b){a.item.internal=b.value})["catch"](function(a){e.error(a)})},a.createItem=function(){var b=angular.copy(a.item);return b.transport&&(b.transport=b.transport.join(",")),a.item.allow&&(b.allow=b.allow.join(";")),g.save(b).$promise.then(function(){c.path("/staff/telephones/list")})["catch"](function(a){e.error(a)})}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.telephones.wizard",{url:"/wizard",templateUrl:"app/staff/telephone/wizard/wizard.html",controller:"TelephoneWizardCtrl"})}]),angular.module("xCallyShuttleApp").controller("UserListCtrl",["$scope","$timeout","User","Auth","gridOptions",function(a,b,c,d,e){function f(a){if(a){var b=_.words(a),c=_.map(b,function(a){return a?a[0]:""});return c.join("").toUpperCase()}return!1}a.getUserAvatar=function(a,c,d){b(function(){angular.element("#userImg"+a).avatar({useGravatar:!1,initials:d?[]:f(c),fallbackImage:"api/users/avatar/"+d,size:80})})},a.isAdmin=function(a){return"admin"===a},a.initView=function(){var b={exporterCsvFilename:"users.csv",columnDefs:[{name:"fullname"},{name:"name",displayName:"APPLICATION_USERNAME"},{name:"internal"},{name:"email"},{name:"description"},{name:"action",width:100,buttons:[{"class":"blue-hoki",href:"/staff/users/view/{{row.entity.id}}/account",name:"profile"},{"class":"green-meadow",href:"/staff/users/view/{{row.entity.id}}/permit/voice",name:"permits",hide:"grid.appScope.isAdmin(row.entity.role)"},{"class":"red-sunglo",name:"delete",onClick:"grid.appScope.deleteItem(row.entity.fullname, row.entity.id)"}]}]};a.gridOptions=e.gridOptions(c,b,a)}}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users.list",{url:"/list",templateUrl:"app/staff/user/list/list.html",controller:"UserListCtrl"})}]),angular.module("xCallyShuttleApp").factory("Module",["$resource",function(a){return a("/api/modules/:id/:controller",{id:"@id"},{update:{method:"PUT"}})}]),angular.module("xCallyShuttleApp").factory("User",["$resource",function(a){return a("/api/users/:id/:controller/:controller2/:controller3",{id:"@id"},{changePassword:{method:"PUT",params:{controller:"password"}},update:{method:"PUT"},me:{method:"GET",params:{id:"me"}}})}]),angular.module("xCallyShuttleApp").config(["$stateProvider",function(a){a.state("main.staff.users",{url:"/users",template:"<div ui-view></div>","abstract":!0,data:{permissions:{only:["admin"],redirectTo:"landing"}}})}]),angular.module("xCallyShuttleApp").controller("UserViewCtrl",["$scope","$stateParams","$cookieStore","$translate","FileUploader","User","Auth","xAlert","MailQueue","VoiceQueue","ChatQueue","FaxQueue","SmsQueue","OpenChannelQueue","Team","Module","Setting",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){function r(b){var c=_.find(a.modules,{id:b.ModuleId});if(b.status===!0)c.status=!0;else{var d=_.filter(c.SubModules,{status:!0});d.length||(c.status=!1)}c.ModuleId&&r(c)}function s(a,b){a.forEach(function(a){a.status=b,a.SubModules&&a.SubModules.length&&s(a.SubModules,b)})}function t(a,b){b.forEach(function(b){_.find(a,{id:b.id})?b.status=!0:b.status=!1,b.SubModules&&b.SubModules.length&&t(a,b.SubModules)})}function u(a,b){return a=_.union(a,_.map(_.filter(b,{status:!0}),"id")),b.forEach(function(b){b.SubModules&&b.SubModules.length&&(a=_.union(a,u(a,b.SubModules)))}),a}a.Auth=g,a._=_,a.moduleSwitch={onText:"On",offText:"Off",isActive:!0,size:"mini",animate:!0,radioOff:!0,handleWidth:"auto",labelWidth:"auto",inverse:!0,offColor:"danger",onColor:"success"},a.initVoiceQueues=function(){var a={},c={};return j.get().$promise.then(function(c){return a.queues=_.map(c.rows,function(a){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'),
 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/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-show="Auth.getCurrentUser().role === \'admin\'">\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'),
 a.put("app/channels/chat/visitor/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-question"></i>\n                                         <a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | 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/visitor/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-question"></i>\n                                 <a href="/channels/chat/visitors/list">{{ \'APPLICATION_VISITORS\' | translate }}</a>\n                                 <i  class="fa fa-angle-right"></i>\n                            </li>\n                         <li data-ng-show="chatVisitor">\n                                       <a href="#">{{chatVisitor.fullname}}</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/visitor.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                                          {{chatVisitor.fullname}}\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.visitors.view.profile\')}">\n                                                        <a data-ng-href="/channels/chat/visitors/view/{{chatVisitor.id}}/profile">\n                                                    <i class="icon-tag"></i>\n                                                      {{ \'APPLICATION_PROFILE\' | 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/visitor/view/view.profile.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_PROFILE\' | translate}}</span>\n                         </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div>\n                                 <h4 class="profile-desc-title">{{chatVisitor.email}}</h4>\n                                     <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-magnifier"></i>\n                                                <a href="#" class="inactive-link">{{chatVisitor.origin}}</a>\n                                  </div>\n                                        <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-globe"></i>\n                                            <a href="#" class="inactive-link">{{chatVisitor.remote_address}}</a>\n                                  </div>\n                                        <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-user"></i>\n                                             <a href="#" class="inactive-link">{{chatVisitor.user_agent | truncate: 50: \'...\'}}</a>\n                                      </div>\n                                        <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-flag"></i>\n                                             <a href="#" class="inactive-link">{{chatVisitor.visitor_language}}</a>\n                                        </div>\n                                        <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-home"></i>\n                                             <a href="#" class="inactive-link">{{chatVisitor.referer}}</a>\n                                 </div>\n                                        <div class="margin-top-20 profile-desc-link">\n                                         <i class="icon-cursor"></i>\n                                           <a href="#" class="inactive-link">{{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">{{chatVisitor.os}}</a>\n                                      </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/website/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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_WEB_SITES\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_WEB_SITES\' | 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                                               <a class="btn green-jungle" href="/channels/chat/websites/wizard">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_WEB_SITE\' | 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/website/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/chat/websites/view/{{chatWebsite.id}}/actions/wizard" data-toggle="dropdown">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),a.put("app/channels/chat/website/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n      <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.settings" ng-submit="updateItem()" novalidate>\n                                      <!-- START APP -->\n                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                       </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END APP -->\n\n                                    <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                          <!-- START QUEUE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n                                                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/chat/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END QUEUE -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                          <!-- START AGENT -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END AGENT -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                          <!-- START SENDMAIL -->\n                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                  <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                      <span data-ng-show="(forms.settings.from.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.mail.$touched || forms.settings.$submitted) && forms.settings.account.$invalid}">\n                                                      <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$invalid}">\n                                                 <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END SENDMAIL -->\n                                 </div>\n\n                                      <!-- START INTERVAL_TYPE -->\n                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n                                           <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                               {{ intType.name | translate }}\n                                                        </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END INTERVAL_TYPE -->\n\n                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                <!-- START TIME -->\n                                           <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                   <div class="input-group input-large">\n                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                             </fieldset>\n                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                     </div>\n                                                </div>\n                                                <!-- END TIME -->\n\n                                           <!-- START ALWAYS -->\n                                         <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                 <div class="input-group input-large">\n                                                         <label class="control-label pointer-cursor">\n                                                                  <input\n                                                                                bs-switch\n                                                                             data-ng-model="application.alwaysTime"\n                                                                                type="checkbox"\n                                                                               switch-active="{{ isActive }}"\n                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                switch-on-color="{{ onColor }}"\n                                                                               switch-off-color="{{ offColor }}"\n                                                                             switch-animate="{{ animate }}"\n                                                                                switch-size="{{ size }}"\n                                                                              switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                              switch-radio-off="{{ radioOff }}"\n                                                                             switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                               </label>\n                                                      </div>\n                                                </div>\n                                                <!-- END ALWAYS -->\n\n                                         <!-- START WEEKDAY -->\n                                                <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                        <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END WEEKDAY -->\n\n                                                <!-- START MONTHDAY -->\n                                               <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                       <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTHDAY -->\n\n                                               <!-- START MONTH -->\n                                          <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                  <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTH -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                          <!-- START INTERVALS -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                    {{ interval.name}}\n                                                            </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                                                               <h4 class="block">Warning!</h4>\n                                                               <p>\n                                                                   {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                                                           </p>\n                                                          <p>\n                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                                                           </p>\n                                                  </div>\n                                                        <span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVALS -->\n\n                                      </div>\n                                        <button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n                          </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/chat/website/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n        <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n                                           <form name="forms.action" novalidate>\n                                                 <!-- START APP -->\n                                                    <div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n                                                               <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APP -->\n\n                                                    <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                                          <!-- START AGENT -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END AGENT -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                        </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                                          <!-- START QUEUE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n                                                                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/chat/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                  </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                                          <!-- START SENDMAIL -->\n                                                               <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1">\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                         <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                                              <span data-ng-show="(forms.action.from.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END SENDMAIL -->\n                                                 </div>\n\n                                                      <!-- START INTERVAL_TYPE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n                                                         <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                               {{ intType.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVAL_TYPE -->\n\n                                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                             </fieldset>\n                                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                     </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                                bs-switch\n                                                                                             data-ng-model="application.alwaysTime"\n                                                                                                type="checkbox"\n                                                                                               switch-active="{{ isActive }}"\n                                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                switch-on-color="{{ onColor }}"\n                                                                                               switch-off-color="{{ offColor }}"\n                                                                                             switch-animate="{{ animate }}"\n                                                                                                switch-size="{{ size }}"\n                                                                                              switch-label="{{ label }}"\n                                                                                            switch-icon="{{ icon }}"\n                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                                               </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate}}\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate }}\n                                                                                        </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                                          <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                                    {{ interval.name}}\n                                                                            </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                         </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n\n                                                      <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n                                         </form>\n                                       </wz-step>\n                                    <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                  </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/chat/website/view/disposition/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$error.required" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n        </span>\n      </div>\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/website/view/disposition/view/view.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_DISPOSITIONS\' | translate}}</span>\n                            </div>\n                                <div class="actions actions-md">\n                                      <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/website/view/embedding/view/view.html",'<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title">\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_EMBEDDING\' | translate}}</span>\n        </div>\n        <div class="actions">\n          <div class="btn-group">\n            <a class="btn green-jungle" href="#" data-ng-click="copyToClipboard();">\n              <i class="fa fa-clipboard"></i> {{\'APPLICATION_COPY_TO_CLIPBOARD\' | translate}}\n            </a>\n          </div>\n        </div>\n      </div>\n      <div class="portlet-body">\n        <div class="row">\n          <div class="col-md-12">\n            <h3>{{\'APPLICATION_EMBED_SNIPPET\' | translate}}</h3>\n            <p>\n              {{\'MESSAGE_EMBED_SNIPPET\' | translate}}\n            </p>\n            <div class="form-body">\n              <div class="form-group">\n                <div class="col-md-12">\n                  <code-mirror lang="html" model="snippetCode"></code-mirror>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("app/channels/chat/website/view/form/view/view.html",'<div class="row" data-ng-init="getChatWebsiteFields(\'online\');getChatWebsiteFields(\'offline\');">\n  <div class="col-md-12">\n    <div class="portlet light">\n      <div class="portlet-title tabbable-line">\n        <ul class="nav nav-tabs">\n          <li class="active">\n            <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_ONLINE\' | translate}}</a>\n          </li>\n          <li>\n            <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n          </li>\n        </ul>\n      </div>\n    <div class="portlet-body">\n      <div class="row">\n        <div class="col-md-12">\n          <div class="tab-content">\n            <div class="tab-pane active" id="tab_1_1">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\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_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'online\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="online"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\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_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n            <div class="tab-pane" id="tab_1_2">\n              <div class="row">\n                <div class="col-md-6">\n                  <div class="portlet">\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_FIELDS_SELECTED\' | translate }}</span>\n                      </div>\n                      <div class="actions">\n                        <div class="btn-group">\n                          <a class="btn green-jungle" href="#" data-ng-click="saveForm(\'offline\');">\n                            <i class="fa fa-check"></i> {{ \'APPLICATION_SAVE\' | translate }}\n                          </a>\n                        </div>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-builder="offline"></div>\n                    </div>\n                  </div>\n                </div>\n                <div class="col-md-6">\n                  <div class="portlet">\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_FIELDS_AVAILABLE\' | translate }}</span>\n                      </div>\n                    </div>\n                    <div class="portlet-body">\n                      <div fb-components></div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n</div>\n'),a.put("app/channels/chat/website/view/hooks/view/view.html",'<div class="row" data-ng-init="initView()">\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_HOOKS\' | 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_ACCEPT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_REJECT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_CLOSE\' | translate}}</a>\n                                        </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- ACCEPT TAB -->\n                                   <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.accept" data-ng-submit="forms.accept.$valid && updateItem()" novalidate>\n                                                    <!-- START ACCEPT URL -->\n                                                             <div class="row">\n                                                                     <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid}">\n                                                                          <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                           <ui-select data-ng-model="account.acceptMethod" name="method" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                                 <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                             <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid && forms.accept.method.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <div  class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                              <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.acceptUrl"  ng-required="account.acceptMethod"/>\n                                                                           <span data-ng-show="(forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid && forms.accept.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                </div>\n                                                                <!-- END ACCEPT URL-->\n                                                                <!-- START ACTIONS-->\n                                                         <!-- START PAUSE -->\n                                                          <div class="row" ng-repeat = "action in account.actions">\n                                                                     <div  ng-switch="action.action">\n                                                                                      <div ng-switch-when="pause">\n                                                                                          <div  class="form-group col-md-4">\n                                                                                                    <label class="control-label">{{\'APPLICATION_PAUSE\' | translate}}</label></br>\n                                                                                                               <input\n                                                                                                                bs-switch\n                                                                                                             data-ng-change="resetActionData(action)"\n                                                                                                              data-ng-model="action.enabled"\n                                                                                                                type="checkbox"\n                                                                                                               switch-active="{{ isActive }}"\n                                                                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                                          switch-on-color="{{ onColor }}"\n                                                                                                               switch-off-color="{{ offColor }}"\n                                                                                                             switch-animate="{{ animate }}"\n                                                                                                                switch-size="{{ size }}"\n                                                                                                              switch-label="{{ label }}"\n                                                                                                            switch-icon="{{ icon }}"\n                                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                                      </div>\n                                                                                                        <div ng-if="action.enabled" class="form-group col-md-8">\n                                                                                                              <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                                                             <ui-select  name="action" data-ng-model="action.type"  theme="bootstrap" >\n                                                                                                                    <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                                                       <ui-select-choices repeat=" pause.name as pause in pauses | filter: $select.search">\n                                                                                                                          <div ng-bind-html="pause.name | highlight: $select.search | uppercase" ></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                  </div>\n                                                                                        </div>\n                                                                        </div>\n                                                                        </div>\n                                                                <!-- END ACTION -->\n                                                           <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START REJECT TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.reject" data-ng-submit="forms.reject.$valid && updateItem()" novalidate>\n                                                    <!-- START REJECT URL -->\n                                                     <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.rejectMethod" name="method" theme="bootstrap" >\n                                                                             <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid && forms.reject.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.rejectUrl" ng-required="account.rejectMethod"/>\n                                                                    <span data-ng-show="(forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid && forms.reject.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n\n                                                      <!-- END REJECT URL -->\n                                                               <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END REJECT TAB -->\n                                       <!-- START CLOSE TAB -->\n                                      <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.close" data-ng-submit="forms.close.$valid && updateItem()" novalidate>\n                                                      <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.closeMethod" name="method" theme="bootstrap" >\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid && forms.close.method.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.closeUrl" ng-required="account.closeMethod"/>\n                                                                      <span data-ng-show="(forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid && forms.close.url.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END CLOSE TAB -->\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/chat/website/view/proactive/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{title}}</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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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 TYPE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.type.$touched || form.$submitted) && form.type.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n      <ui-select name="type" ng-model="item.type" theme="bootstrap" ng-disabled="disabled">\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.title}}</ui-select-match>\n        <ui-select-choices repeat="item.type as item in possibleType | filter: $select.search">\n          <div ng-bind-html="item.title | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n    <!-- END TYPE -->\n\n    <!-- START SELECTOR -->\n    <div class="form-group" data-ng-if="item.type === \'mouseOver\'" data-ng-class="{\'has-error\': (form.selector.$touched || form.$submitted) && form.selector.$invalid}">\n      <label class="control-label">{{\'APPLICATION_SELECTOR\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="selector" placeholder="{{\'APPLICATION_SELECTOR\' | translate}}" class="form-control" data-ng-model="item.selector" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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 SELECTOR -->\n\n    <!-- START TIMEOUT -->\n    <div class="form-group" data-ng-if="item.type === \'timeout\'" data-ng-class="{\'has-error\': (form.timeout.$touched || form.$submitted) && form.timeout.$invalid}">\n      <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.timeout" min="0" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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 TIMEOUT -->\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/website/view/proactive/list/list.html",'<div class="row" data-ng-init="initProactiveActions()">\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_PROACTIVE_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="#" data-toggle="dropdown" data-ng-click="createItem()">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROACTIVE_ACTION\' | 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        </div>\n</div>\n'),a.put("app/channels/chat/website/view/setting/view/view.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" data-ng-init="initView()">\n                                          <form name="forms.info" data-ng-submit="forms.info.$valid && updateItemChatWebsite()" novalidate>\n                                                     <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="chatWebsite.ListId" name="list" theme="bootstrap">\n                                                                                  <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="chatWebsite.ListId = null" class="btn btn-default">\n                                                                                              <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\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/website/view/snippet/view/view.html",'<div class="row" data-ng-init="initView()">\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_SNIPPET\' | 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_APPEARANCE\' | translate}}</a>\n                                   </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_FORMS\' | translate}}</a>\n                                        </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_LABELS\' | translate}}</a>\n                                       </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_SETTINGS\' | translate}}</a>\n                                     </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_5" data-toggle="tab">{{\'APPLICATION_OFFLINE\' | translate}}</a>\n                                      </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="row">\n                                             <div class="col-md-8">\n                                                        <div class="tab-content">\n\n                                                           <!-- APPEARANCE TAB -->\n                                                               <div class="tab-pane active" id="tab_1_1">\n                                                                    <form name="forms.formAppearance" data-ng-submit="forms.formAppearance.$valid && updateItem()" novalidate>\n\n                                                                          <!-- START MAIN COLOR -->\n                                                                             <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.host.$invalid}">\n                                                                                  <label class="control-label">{{\'APPLICATION_MAIN_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                  <input colorpicker type="text" name="mainColor" placeholder="{{\'APPLICATION_MAIN_COLOR\' | translate}}" style="color:{{chatWebsite.color}}" class="form-control" data-ng-model="chatWebsite.color" required/>\n                                                                                        <span data-ng-show="(forms.formAppearance.mainColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.mainColor.$invalid && forms.formAppearance.mainColor.$error.required" class="help-block help-block-error">\n                                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END MAIN COLOR -->\n\n                                                                             <!-- START FOCUS COLOR -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_FOCUS_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                 <input colorpicker type="text" name="focusColor" placeholder="{{\'APPLICATION_FOCUS_COLOR\' | translate}}" style="color:{{chatWebsite.color_focus}}" class="form-control" data-ng-model="chatWebsite.color_focus" required/>\n                                                                                  <span data-ng-show="(forms.formAppearance.focusColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.focusColor.$invalid && forms.formAppearance.focusColor.$error.required" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END FOCUS COLOR -->\n\n                                                                            <!-- START BUTTON COLOR -->\n                                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_BUTTON_COLOR\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                        <input colorpicker type="text" name="buttonColor" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" style="color:{{chatWebsite.color_button}}" class="form-control" data-ng-model="chatWebsite.color_button" required/>\n                                                                                      <span data-ng-show="(forms.formAppearance.buttonColor.$touched || forms.formAppearance.$submitted) && forms.formAppearance.buttonColor.$invalid && forms.formAppearance.buttonColor.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END BUTTON COLOR -->\n\n                                                                           <!-- START HEADER SHAPE -->\n                                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.headerShape.$touched || forms.formAppearance.$submitted) && forms.formAppearance.headerShape.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_HEADER_SHAPE\' | translate}}</label>\n                                                                                     <!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n                                                                                       <ui-select data-ng-model="chatWebsite.header_shape" name="headerShape" theme="bootstrap">\n                                                                                             <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant(\'APPLICATION_\' + $select.selected.toUpperCase())}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="headerShape in [\'rounded\',\'squared\'] | filter: $select.search">\n                                                                                                        <div ng-bind-html="$translate.instant(\'APPLICATION_\' + headerShape.toUpperCase()) | highlight: $select.search"></div>\n                                                                                               </ui-select-choices>\n                                                                                  </ui-select>\n                                                                          </div>\n                                                                                <!-- END HEADER SHAPE -->\n\n                                                                           <!-- START ANIMATION TOGGLE -->\n                                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.animationToggle.$touched || forms.formAppearance.$submitted) && forms.formAppearance.animationToggle.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label></br>\n                                                                                   <!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n                                                                                       <input\n                                                                                        bs-switch\n                                                                                     class="form-control"\n                                                                                  ng-model="chatWebsite.animation"\n                                                                                      type="checkbox"\n                                                                                       switch-active="{{ true }}"\n                                                                                    switch-on-text="{{\'APPLICATION_YES\' | translate}}"\n                                                                                  switch-off-text="{{\'APPLICATION_NO\' | translate}}"\n                                                                                  switch-on-color="{{ radioSwitch.onColor }}"\n                                                                                   switch-off-color="{{ radioSwitch.offColor }}"\n                                                                                 switch-animate="{{ radioSwitch.animate }}"\n                                                                                    switch-size="{{ radioSwitch.size }}"\n                                                                                  switch-label="{{ radioSwitch.label }}"\n                                                                                        switch-icon="{{ radioSwitch.icon }}"\n                                                                                  switch-radio-off="{{ radioSwitch.radioOff }}"\n                                                                                 switch-label-width="{{ radioSwitch.labelWidth }}"\n                                                                                     switch-handle-width="{{ radioSwitch.handleWidth }}">\n                                                                          </div>\n                                                                                <!-- END ANIMATION TOGGLE -->\n\n                                                                               <div class="portlet-title tabbable-line margin-top20">\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_WHITE_LABEL\' | translate}}</span>\n                                                                                     </div>\n                                                                                </div>\n\n                                                                              <div class="form-group">\n                                                                                      <label class="control-label">{{\'APPLICATION_DEFAULT\' | translate}}</label></br>\n                                                                                     <input\n                                                                                        bs-switch\n                                                                                     class="form-control"\n                                                                                  ng-model="chatWebsite.defaultWhiteLabel"\n                                                                                      data-ng-init="chatWebsite.defaultWhiteLabel = license.custom ? chatWebsite.defaultWhiteLabel : true"\n                                                                                  type="checkbox"\n                                                                                       name="defaultWhitelabel"\n                                                                                      switch-active="{{ radioSwitch.isActive }}"\n                                                                                    switch-on-text="{{\'APPLICATION_YES\' | translate}}"\n                                                                                  switch-off-text="{{\'APPLICATION_NO\' | translate}}"\n                                                                                  switch-on-color="{{ radioSwitch.onColor }}"\n                                                                                   switch-off-color="{{ radioSwitch.offColor }}"\n                                                                                 switch-animate="{{ radioSwitch.animate }}"\n                                                                                    switch-size="{{ radioSwitch.size }}"\n                                                                                  switch-label="{{ radioSwitch.label }}"\n                                                                                        switch-icon="{{ radioSwitch.icon }}"\n                                                                                  switch-radio-off="{{ radioSwitch.radioOff }}"\n                                                                                 switch-label-width="{{ radioSwitch.labelWidth }}"\n                                                                                     switch-handle-width="{{ radioSwitch.handleWidth }}">\n                                                                          </div>\n                                                                                <!-- END DEFAULT -->\n                                                                          <!-- START LABEL -->\n                                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.formAppearance.whiteLabel.$touched || forms.formAppearance.$submitted) && forms.formAppearance.whiteLabel.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_WHITE_LABEL\' | translate}}<span data-ng-if="!chatWebsite.defaultWhiteLabel" class="required" aria-required="true">*</span></label>\n                                                                                      <textarea type="password" name="whiteLabel" placeholder="{{\'APPLICATION_WHITE_LABEL\' | translate}}" class="form-control" data-ng-model="chatWebsite.whiteLabel" data-ng-disabled="chatWebsite.defaultWhiteLabel || !license.custom" data-ng-required="!chatWebsite.defaultWhiteLabel && license.custom"/></textarea>\n                                                                                        <span data-ng-show="(forms.formAppearance.whiteLabel.$touched || forms.formAppearance.$submitted) && forms.formAppearance.whiteLabel.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END LABEL -->\n\n                                                                          <div class="portlet-title tabbable-line margin-top20">\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_LOGO\' | translate}}</span>\n                                                                                    </div>\n                                                                                </div>\n                                                                                <div class="row">\n\n                                                                                   <div class="form-group col-md-6 col-sm-6">\n                                                                                            <label class="control-label">{{\'APPLICATION_DEFAULT\' | translate}}</label></br>\n                                                                                             <input\n                                                                                                bs-switch\n                                                                                             class="form-control"\n                                                                                          ng-model="chatWebsite.defaultLogo"\n                                                                                            data-ng-init="chatWebsite.defaultLogo = license.custom ? chatWebsite.defaultLogo : true"\n                                                                                              type="checkbox"\n                                                                                               name="defaultLogo"\n                                                                                            switch-active="{{ radioSwitch.isActive }}"\n                                                                                            switch-on-text="{{\'APPLICATION_YES\' | translate}}"\n                                                                                          switch-off-text="{{\'APPLICATION_NO\' | translate}}"\n                                                                                          switch-on-color="{{ radioSwitch.onColor }}"\n                                                                                           switch-off-color="{{ radioSwitch.offColor }}"\n                                                                                         switch-animate="{{ radioSwitch.animate }}"\n                                                                                            switch-size="{{ radioSwitch.size }}"\n                                                                                          switch-label="{{ radioSwitch.label }}"\n                                                                                                switch-icon="{{ radioSwitch.icon }}"\n                                                                                          switch-radio-off="{{ radioSwitch.radioOff }}"\n                                                                                         switch-label-width="{{ radioSwitch.labelWidth }}"\n                                                                                             switch-handle-width="{{ radioSwitch.handleWidth }}">\n                                                                                  </div>\n                                                                                        <!-- END STATUS -->\n                                                                                   <div class="form-group col-md-6 col-sm-6" data-ng-if="!chatWebsite.defaultLogo && license.custom">\n                                                                                            <div class="fileinput fileinput-new" data-provides="fileinput">\n                                                                                                       <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">\n                                                                                                            <img ng-src="assets/images/media/noProfileImage.png" alt=""/>\n                                                                                                 </div>\n                                                                                                        <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">\n                                                                                                       </div>\n                                                                                                        <div>\n                                                                                                         <span class="btn default btn-file" data-ng-show="!uploader.queue[0]">\n                                                                                                                 <span> {{ \'APPLICATION_SELECT_IMAGE\' | translate }} </span>\n                                                                                                                 <input type="file" nv-file-select="" uploader="uploader"/><br/>\n                                                                                                               </span>\n                                                                                                               <button type="button" class="btn default" data-ng-show="uploader.queue[0]" data-dismiss="fileinput" ng-click="uploader.queue[0].remove()">\n                                                                                                                    {{ \'APPLICATION_REMOVE\' | translate }}\n                                                                                                              <!-- </button>\n                                                                                                                <button type="button" class="btn green-haze" data-ng-show="uploader.queue[0]" data-ng-click="uploader.queue[0].upload()" ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess">\n                                                                                                                     {{ \'APPLICATION_CONFIRM\' | translate }}\n                                                                                                             </button> -->\n                                                                                                 </div>\n                                                                                                        <p>\n                                                                                                   </br> {{ \'MESSAGE_SUPPORTED_FORMATS\' | translate }} <b>jpg, png, jpeg</b>.\n                                                                                          </p>\n                                                                                  </div>\n                                                                                </div>\n                                                                        </div>\n                                                                        <div class="row">\n                                                                             <div class="col-md-2">\n                                                                                        <table class="table" border="0">\n                                                                                              <tbody>\n                                                                                                       <tr data-ng-repeat="item in uploader.queue">\n                                                                                                          <td style="border-top-style:none">\n                                                                                                                    <strong>\n                                                                                                                              {{ item.file.name }}\n                                                                                                                  </strong>\n                                                                                                             </td>\n                                                                                                         <td data-ng-show="uploader.isHTML5" nowrap style="border-top-style:none">\n                                                                                                                     {{ item.file.size/1024/1024|number:2 }} MB\n                                                                                                            </td>\n                                                                                                         <td nowrap style="border-top-style:none">\n                                                                                                                     <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n                                                                                                                            <span class="glyphicon glyphicon-trash"></span> Remove\n                                                                                                                        </button>\n                                                                                                             </td>\n                                                                                                 </tr>\n                                                                                         </tbody>\n                                                                                      </table>\n                                                                              </div>\n                                                                        </div>\n\n                                                                              <input class="btn green-haze" type="submit" data-ng-click="uploader.queue[0] && uploader.queue[0].upload()" data-ng-disabled="uploader.queue[0].isReady || uploader.queue[0].isUploading || uploader.queue[0].isSuccess" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                                     </form>\n                                                               </div>\n                                                                <!-- END APPEARANCE TAB -->\n\n                                                         <!-- FORMS TAB -->\n                                                            <div class="tab-pane" id="tab_1_2">\n                                                                   <form name="forms.formFunctionality" data-ng-submit="forms.formFunctionality.$valid && updateItem()" novalidate>\n\n                                                                            <!-- START DOWNLOAD TRANSCRIPT -->\n                                                                            <div class="form-group">\n                                                                                      <label class="control-label">{{\'APPLICATION_DOWNLOAD_TRANSCRIPT\' | translate}}</label>\n                                                                                      </br>\n                                                                                 <input\n                                                                                        bs-switch\n                                                                                     class="form-control"\n                                                                                  ng-model="chatWebsite.download_transcript"\n                                                                                    type="checkbox"\n                                                                                       switch-active="true"\n                                                                                  switch-on-text="{{\'APPLICATION_YES\' | translate}}"\n                                                                                  switch-off-text="{{\'APPLICATION_NO\' | translate}}"\n                                                                                  switch-on-color="{{ radioSwitch.onColor }}"\n                                                                                   switch-off-color="{{ radioSwitch.offColor }}"\n                                                                                 switch-animate="{{ radioSwitch.animate }}"\n                                                                                    switch-size="{{ radioSwitch.size }}"\n                                                                                  switch-label="{{ radioSwitch.label }}"\n                                                                                        switch-icon="{{ radioSwitch.icon }}"\n                                                                                  switch-radio-off="{{ radioSwitch.radioOff }}"\n                                                                                 switch-label-width="{{ radioSwitch.labelWidth }}"\n                                                                                     switch-handle-width="{{ radioSwitch.handleWidth }}">\n                                                                          </div>\n                                                                                <!-- END DOWNLOAD TRANSCRIPT -->\n\n                                                                            <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                                  </form>\n                                                               </div>\n                                                                <!-- END FORMS TAB -->\n\n                                                              <!-- STRINGS TAB -->\n                                                          <div class="tab-pane" id="tab_1_3">\n                                                                   <form name="forms.formLabel" data-ng-submit="forms.formLabel.$valid && updateItem()" novalidate>\n\n                                                                            <h4 class="block" data-ng-show="statePreview.state == \'online\'">{{\'APPLICATION_ONLINE_STATE\' | translate}}</h4>\n\n                                                                         <!-- START HEADER ONLINE -->\n                                                                          <div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOnline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n                                                                                      <label class="control-label">{{\'APPLICATION_HEADER_ONLINE\' | translate}}</label>\n                                                                                    <input type="text" name="headerOnline" placeholder="{{\'APPLICATION_HEADER_ONLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_online"/>\n                                                                           </div>\n                                                                                <!-- END HEADER ONLINE -->\n\n                                                                          <!-- START ONLINE MESSAGE-->\n                                                                          <div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.onlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.onlineMessage.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}</label>\n                                                                                   <input type="text" name="onlineMessage" placeholder="{{\'APPLICATION_ONLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.online_message"/>\n                                                                                </div>\n                                                                                <!-- END HEADER ONLINE -->\n\n                                                                          <!-- START USERNAME TITLE -->\n                                                                         <div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.nameTitle.$touched || forms.formLabel.$submitted) && forms.formLabel.nameTitle.$invalid}">\n                                                                                       <label class="control-label">{{\'APPLICATION_USERNAME_TITLE\' | translate}}</label>\n                                                                                   <input type="text" name="nameTitle" placeholder="{{\'APPLICATION_USERNAME_TITLE\' | translate}}" class="form-control" data-ng-model="chatWebsite.name_title"/>\n                                                                                </div>\n                                                                                <!-- END USERNAME TITLE -->\n\n                                                                         <!-- START USERNAME PLACEHOLDER -->\n                                                                           <div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.usernamePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.usernamePlaceholder.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}</label>\n                                                                                     <input type="text" name="usernamePlaceholder" placeholder="{{\'APPLICATION_USERNAME_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.username_placeholder"/>\n                                                                              </div>\n                                                                                <!-- END USERNAME PLACEHOLDER -->\n\n                                                                           <!-- START EMAIL TITLE -->\n                                                                            <div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.emailTitle.$touched || forms.formLabel.$submitted) && forms.formLabel.emailTitle.$invalid}">\n                                                                                     <label class="control-label">{{\'APPLICATION_EMAIL_TITLE\' | translate}}</label>\n                                                                                      <input type="text" name="emailTitle" placeholder="{{\'APPLICATION_EMAIL_TITLE\' | translate}}" class="form-control" data-ng-model="chatWebsite.email_title"/>\n                                                                         </div>\n                                                                                <!-- END EMAIL TITLE -->\n\n                                                                            <!-- START EMAIL PLACEHOLDER -->\n                                                                              <div class="form-group" data-ng-show="statePreview.state == \'online\' || statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.emailPlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.emailPlaceholder.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}</label>\n                                                                                        <input type="text" name="emailPlaceholder" placeholder="{{\'APPLICATION_EMAIL_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.email_placeholder"/>\n                                                                               </div>\n                                                                                <!-- END EMAIL PLACEHOLDER -->\n\n                                                                              <!-- START START CHAT BUTTON -->\n                                                                              <div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.startChatButton.$touched || forms.formLabel.$submitted) && forms.formLabel.startChatButton.$invalid}">\n                                                                                        <label class="control-label">{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}</label>\n                                                                                        <input type="text" name="startChatButton" placeholder="{{\'APPLICATION_START_CHAT_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.start_chat_button"/>\n                                                                                </div>\n                                                                                <!-- END START CHAT BUTTON -->\n\n                                                                              <h4 class="block" data-ng-show="statePreview.state == \'rating\'">{{\'APPLICATION_RATING_STATE\' | translate}}</h4>\n\n                                                                         <!-- START RATING MESSAGE -->\n                                                                         <div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingMessage.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_RATING_MESSAGE\' | translate}}</label>\n                                                                                   <input type="text" name="ratingMessage" placeholder="{{\'APPLICATION_RATING_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_message"/>\n                                                                                </div>\n                                                                                <!-- END RATING MESSAGE -->\n\n                                                                         <!-- START RATING SEND BUTTON -->\n                                                                             <div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSend.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSend.$invalid}">\n                                                                                  <label class="control-label">{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}</label>\n                                                                                       <input type="text" name="ratingSend" placeholder="{{\'APPLICATION_RATING_SEND_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_send"/>\n                                                                          </div>\n                                                                                <!-- END RATING SEND BUTTON -->\n\n                                                                             <!-- START RATING SKIP BUTTON -->\n                                                                             <div class="form-group" data-ng-show="statePreview.state == \'rating\'" data-ng-class="{\'has-error\': (forms.formLabel.ratingSkip.$touched || forms.formLabel.$submitted) && forms.formLabel.ratingSkip.$invalid}">\n                                                                                  <label class="control-label">{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}</label>\n                                                                                       <input type="text" name="ratingSkip" placeholder="{{\'APPLICATION_RATING_SKIP_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.rating_skip"/>\n                                                                          </div>\n                                                                                <!-- END RATING SKIP BUTTON -->\n\n                                                                             <h4 class="block" data-ng-show="statePreview.state == \'offline\'">{{\'APPLICATION_OFFLINE_STATE\' | translate}}</h4>\n\n                                                                               <!-- START HEADER OFFLINE -->\n                                                                         <div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.headerOffline.$touched || forms.formLabel.$submitted) && forms.formLabel.headerOnline.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_HEADER_OFFLINE\' | translate}}</label>\n                                                                                   <input type="text" name="headerOffline" placeholder="{{\'APPLICATION_HEADER_OFFLINE\' | translate}}" class="form-control" data-ng-model="chatWebsite.header_offline"/>\n                                                                                </div>\n                                                                                <!-- END HEADER OFFLINE -->\n\n                                                                         <!-- START OFFLINE MESSAGE-->\n                                                                         <div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.offlineMessage.$touched || forms.formLabel.$submitted) && forms.formLabel.offlineMessage.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}</label>\n                                                                                  <input type="text" name="offlineMessage" placeholder="{{\'APPLICATION_OFFLINE_MESSAGE\' | translate}}" class="form-control" data-ng-model="chatWebsite.offline_message"/>\n                                                                             </div>\n                                                                                <!-- END OFFLINE MESSAGE -->\n\n                                                                                <!-- START ENQUIRY MESSAGE TITLE-->\n                                                                           <div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessageTitle.$touched || forms.formLabel.$submitted) && forms.formLabel.enquiryMessageTitle.$invalid}">\n                                                                                       <label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_TITLE\' | translate}}</label>\n                                                                                    <input type="text" name="enquiryMessageTitle" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_TITLE\' | translate}}" class="form-control" data-ng-model="chatWebsite.message_title"/>\n                                                                            </div>\n                                                                                <!-- END ENQUIRY MESSAGE TITLE -->\n\n                                                                          <!-- START ENQUIRY MESSAGE PLACEHOLDER-->\n                                                                             <div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryMessagePlaceholder.$touched || forms.formLabel.$submitted) && forms.formLabel.enquiryMessagePlaceholder.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}</label>\n                                                                                      <input type="text" name="enquiryMessagePlaceholder" placeholder="{{\'APPLICATION_ENQUIRY_MESSAGE_PLACEHOLDER\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_message_placeholder"/>\n                                                                          </div>\n                                                                                <!-- END ENQUIRY MESSAGE PLACEHOLDER -->\n\n                                                                            <!-- START ENQUIRY BUTTON -->\n                                                                         <div class="form-group" data-ng-show="statePreview.state == \'offline\'" data-ng-class="{\'has-error\': (forms.formLabel.enquiryButton.$touched || forms.formLabel.$submitted) && forms.formLabel.enquiryButton.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}</label>\n                                                                                   <input type="text" name="enquiryButton" placeholder="{{\'APPLICATION_ENQUIRY_BUTTON\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_button"/>\n                                                                                </div>\n                                                                                <!-- END ENQUIRY BUTTON -->\n\n                                                                         <!-- START AGENTS BUSY BUTTON -->\n                                                                             <div class="form-group" data-ng-show="statePreview.state == \'online\'" data-ng-class="{\'has-error\': (forms.formLabel.agentsBusy.$touched || forms.formLabel.$submitted) && forms.formLabel.agentsBusy.$invalid}">\n                                                                                  <label class="control-label">{{\'APPLICATION_AGENTS_BUSY\' | translate}}</label>\n                                                                                      <input type="text" name="agentsBusy" placeholder="{{\'APPLICATION_AGENTS_BUSY\' | translate}}" class="form-control" data-ng-model="chatWebsite.agents_busy"/>\n                                                                         </div>\n                                                                                <!-- END AGENTS BUSY BUTTON -->\n\n                                                                             <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                                  </form>\n                                                               </div>\n                                                                <!-- END STRINGS TAB -->\n\n                                                            <!-- SETTINGS TAB -->\n                                                         <div class="tab-pane" id="tab_1_4">\n                                                                   <form name="forms.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n\n                                                                                <!-- START NAME -->\n                                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSetting.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="chatWebsite.name" required/>\n                                                                                    <span data-ng-show="(forms.formSetting.name.$touched || forms.formSetting.$submitted) && forms.formSettings.name.$invalid && forms.formSetting.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 ADDRESS -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid}">\n                                                                                  <label class="control-label">{{\'APPLICATION_WEB_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                 <input type="url" name="address" placeholder="{{\'APPLICATION_WEB_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.address" required/>\n                                                                                        <span data-ng-show="(forms.formSetting.address.$touched || forms.formSetting.$submitted) && forms.formSetting.address.$invalid && forms.formSetting.address.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END ADDRESS -->\n\n                                                                                <!-- START REMOTE IP -->\n                                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                      <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.remote" required/>\n                                                                                       <span data-ng-show="(forms.formSetting.remote.$touched || forms.formSetting.$submitted) && forms.formSetting.remote.$invalid && forms.formSetting.remote.$error.required" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                                       <span class="help-block help-block-info">\n                                                                                             {{\'MESSAGE_MOTION_ADDRESS_FORMAT\' | translate}}\n                                                                                     </span>\n                                                                               </div>\n                                                                                <!-- END REMOTE IP -->\n\n                                                                              <!-- START FIDELITY -->\n                                                                               <div class="form-group">\n                                                                                      <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                                                    <input\n                                                                                        bs-switch\n                                                                                     data-ng-model="chatWebsite.fidelity"\n                                                                                  type="checkbox"\n                                                                                       switch-active="{{ fidelitySwitch.isActive }}"\n                                                                                 switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                    switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                  switch-on-color="{{ fidelitySwitch.onColor }}"\n                                                                                        switch-off-color="{{ fidelitySwitch.offColor }}"\n                                                                                      switch-animate="{{ fidelitySwitch.animate }}"\n                                                                                 switch-size="{{ fidelitySwitch.size }}"\n                                                                                       switch-label="{{ fidelitySwitch.label }}"\n                                                                                     switch-icon="{{ fidelitySwitch.icon }}"\n                                                                                       switch-radio-off="{{ fidelitySwitch.radioOff }}"\n                                                                                      switch-label-width="{{ fidelitySwitch.labelWidth }}"\n                                                                                  switch-handle-width="{{ fidelitySwitch.handleWidth }}">\n                                                                               </div>\n                                                                                <!-- END FIDELITY -->\n\n                                                                               <!-- START TIMEOUT -->\n                                                                                <div class="form-group" data-ng-if="chatWebsite.fidelity" data-ng-class="{\'has-error\': (forms.formSetting.timeout.$touched || forms.formSetting.$submitted) && forms.formSetting.timeout.$invalid}">\n                                                                                        <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                      <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="chatWebsite.timeout" required/>\n                                                                                 <span data-ng-show="(forms.formSetting.timeout.$touched || forms.formSetting.$submitted) && forms.formSetting.timeout.$invalid && forms.formSetting.timeout.$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.formSetting.timeout.$touched || forms.formSetting.$submitted) && forms.formSetting.timeout.$invalid && forms.formSetting.timeout.$error.number" class="help-block help-block-error">\n                                                                                               <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                                                  </span>\n                                                                               </div>\n                                                                                <!-- END TIMEOUT -->\n\n                                                                                <!-- START DESCRIPTION -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.formSetting.description.$touched || forms.formSetting.$submitted) && forms.formSetting.description.$invalid}">\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="chatWebsite.description"/>\n                                                                                </div>\n                                                                                <!-- END DESCRIPTION -->\n\n                                                                            <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                                  </form>\n                                                               </div>\n                                                                <!-- END SETTINGS TAB -->\n\n                                                           <!-- OFFLINE TAB -->\n                                                          <div class="tab-pane" id="tab_1_5">\n                                                                   <form name="forms.formOffline" data-ng-submit="forms.formOffline.$valid && updateItem()" novalidate>\n\n                                                                                <!-- START ENQUIRY ENABLE -->\n                                                                         <div class="form-group">\n                                                                                      <label class="control-label">{{\'APPLICATION_ENQUIRY_ENABLED\' | translate}}</label></br>\n                                                                                     <input\n                                                                                            bs-switch\n                                                                                                 class="form-control"\n                                                                                      ng-model="chatWebsite.enquiry_enable"\n                                                                                         type="checkbox"\n                                                                                       switch-active="{{ enquirySwitch.isActive }}"\n                                                                                          switch-on-text="{{ enquirySwitch.onText }}"\n                                                                                           switch-off-text="{{ enquirySwitch.offText }}"\n                                                                                         switch-on-color="{{ enquirySwitch.onColor }}"\n                                                                                         switch-off-color="{{ enquirySwitch.offColor }}"\n                                                                                       switch-animate="{{ enquirySwitch.animate }}"\n                                                                                          switch-size="{{ enquirySwitch.size }}"\n                                                                                        switch-label="{{ enquirySwitch.label }}"\n                                                                                      switch-icon="{{ enquirySwitch.icon }}"\n                                                                                        switch-radio-off="{{ enquirySwitch.radioOff }}"\n                                                                                       switch-label-width="{{ enquirySwitch.labelWidth }}"\n                                                                                           switch-handle-width="{{ enquirySwitch.handleWidth }}">\n                                                                            </div>\n                                                                                <!-- END ENQUIRY ENABLE -->\n\n                                                                         <!-- START ENQUIRY FORWARDING -->\n                                                                             <div class="form-group" data-ng-if="chatWebsite.enquiry_enable">\n                                                                                      <label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING\' | translate}}</label></br>\n                                                                                  <input\n                                                                                            bs-switch\n                                                                                                 class="form-control"\n                                                                                      ng-model="chatWebsite.enquiry_forwarding"\n                                                                                     type="checkbox"\n                                                                                       switch-active="{{ enquirySwitch.isActive }}"\n                                                                                          switch-on-text="{{ enquirySwitch.onText }}"\n                                                                                           switch-off-text="{{ enquirySwitch.offText }}"\n                                                                                         switch-on-color="{{ enquirySwitch.onColor }}"\n                                                                                         switch-off-color="{{ enquirySwitch.offColor }}"\n                                                                                       switch-animate="{{ enquirySwitch.animate }}"\n                                                                                          switch-size="{{ enquirySwitch.size }}"\n                                                                                        switch-label="{{ enquirySwitch.label }}"\n                                                                                      switch-icon="{{ enquirySwitch.icon }}"\n                                                                                        switch-radio-off="{{ enquirySwitch.radioOff }}"\n                                                                                       switch-label-width="{{ enquirySwitch.labelWidth }}"\n                                                                                           switch-handle-width="{{ enquirySwitch.handleWidth }}">\n                                                                                    <span class="help-block col-md-12">{{\'MESSAGE_REMEMBER_SMTP_SERVICE_ACCOUNT\' | translate}}.</span>\n                                                                          </div>\n                                                                                <!-- END ENQUIRY FORWARDING -->\n\n                                                                             <!-- START REMOTE IP -->\n                                                                              <div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formSetting.forwardingAddress.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_ENQUIRY_FORWARDING_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                   <input type="text" name="forwardingAddress" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="chatWebsite.enquiry_forwarding_address" required/>\n                                                                                      <span data-ng-show="(forms.formOffline.forwardingAddress.$touched || forms.formOffline.$submitted) && forms.formOffline.forwardingAddress.$invalid && forms.formOffline.forwardingAddress.$error.required" class="help-block help-block-error">\n                                                                                               <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END REMOTE IP -->\n\n                                                                              <!-- START HEADER SHAPE -->\n                                                                           <div class="form-group" data-ng-if="chatWebsite.enquiry_enable && chatWebsite.enquiry_forwarding" data-ng-class="{\'has-error\': (forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid}">\n                                                                                    <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                     <ui-select data-ng-model="chatWebsite.OfflineTemplateId" name="OfflineTemplateId" theme="bootstrap" required>\n                                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                                          </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <span data-ng-show="(forms.formOffline.OfflineTemplateId.$touched || forms.formOffline.$submitted) && forms.formOffline.OfflineTemplateId.$invalid && forms.formOffline.OfflineTemplateId.$error.required" class="help-block help-block-error">\n                                                                                               <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END HEADER SHAPE -->\n\n                                                                           <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                                  </form>\n                                                               </div>\n                                                                <!-- END OFFLINE TAB -->\n                                                      </div>\n                                                </div>\n                                                <div class="col-md-4">\n                                                        <!-- START STATE -->\n                                                  <div class="form-group">\n                                                              <!-- <label class="control-label">{{\'APPLICATION_ANIMATION\' | translate}}</label> -->\n                                                               <!-- <input colorpicker type="text" name="animationToggle" placeholder="{{\'APPLICATION_BUTTON_COLOR\' | translate}}" class="form-control" data-ng-model="chatWebsite.animation" required/> -->\n                                                               <ui-select data-ng-model="statePreview.state" name="statePreview" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                   <ui-select-choices repeat="statePreview in [\'online\',\'rating\',\'offline\'] | filter: $select.search">\n                                                                             <div ng-bind-html="statePreview | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                        <!-- END STATE -->\n                                                    <preview></preview>\n                                           </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
@@ -35,21 +35,21 @@ a.put("app/channels/chat/website/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<d
 a.put("app/channels/fax/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.settings" ng-submit="updateItem()" novalidate>\n                                      <!-- START APP -->\n                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                       </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END APP -->\n\n                                    <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                          <!-- START QUEUE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.FaxQueueId" name="queue" theme="bootstrap" required>\n                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/fax/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                        <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END QUEUE -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                          <!-- START AGENT -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END AGENT -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                          <!-- START SENDMAIL -->\n                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                  <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                      <span data-ng-show="(forms.settings.from.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.timeout.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.mail.$touched || forms.settings.$submitted) && forms.settings.account.$invalid}">\n                                                      <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$invalid}">\n                                                 <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END SENDMAIL -->\n                                 </div>\n\n                                      <!-- START INTERVAL_TYPE -->\n                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n                                           <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                               {{ intType.name | translate }}\n                                                        </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END INTERVAL_TYPE -->\n\n                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                <!-- START TIME -->\n                                           <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                   <div class="input-group input-large">\n                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                             </fieldset>\n                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                     </div>\n                                                </div>\n                                                <!-- END TIME -->\n\n                                           <!-- START ALWAYS -->\n                                         <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                 <div class="input-group input-large">\n                                                         <label class="control-label pointer-cursor">\n                                                                  <input\n                                                                                bs-switch\n                                                                             data-ng-model="application.alwaysTime"\n                                                                                type="checkbox"\n                                                                               switch-active="{{ isActive }}"\n                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                switch-on-color="{{ onColor }}"\n                                                                               switch-off-color="{{ offColor }}"\n                                                                             switch-animate="{{ animate }}"\n                                                                                switch-size="{{ size }}"\n                                                                              switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                              switch-radio-off="{{ radioOff }}"\n                                                                             switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                               </label>\n                                                      </div>\n                                                </div>\n                                                <!-- END ALWAYS -->\n\n                                         <!-- START WEEKDAY -->\n                                                <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                        <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END WEEKDAY -->\n\n                                                <!-- START MONTHDAY -->\n                                               <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                       <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTHDAY -->\n\n                                               <!-- START MONTH -->\n                                          <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                  <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTH -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                          <!-- START INTERVALS -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                    {{ interval.name}}\n                                                            </ui-select-choices>\n                                                  </ui-select>\n              <div class="note note-warning" data-ng-hide="intervals.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_INTERVALS_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVALS -->\n\n                                      </div>\n                                        <button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n                          </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/account/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n                                           <form name="forms.action" novalidate>\n                                                 <!-- START APP -->\n                                                    <div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n                                                               <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APP -->\n\n                                                    <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                                          <!-- START AGENT -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END AGENT -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                        </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                                          <!-- START QUEUE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.FaxQueueId" name="queue" theme="bootstrap" required>\n                                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/fax/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                        </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                  </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                                          <!-- START SENDMAIL -->\n                                                               <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1">\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                         <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                                              <span data-ng-show="(forms.action.from.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END SENDMAIL -->\n                                                 </div>\n\n                                                      <!-- START INTERVAL_TYPE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n                                                         <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                               {{ intType.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVAL_TYPE -->\n\n                                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                             </fieldset>\n                                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                     </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                                bs-switch\n                                                                                             data-ng-model="application.alwaysTime"\n                                                                                                type="checkbox"\n                                                                                               switch-active="{{ isActive }}"\n                                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                switch-on-color="{{ onColor }}"\n                                                                                               switch-off-color="{{ offColor }}"\n                                                                                             switch-animate="{{ animate }}"\n                                                                                                switch-size="{{ size }}"\n                                                                                              switch-label="{{ label }}"\n                                                                                            switch-icon="{{ icon }}"\n                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                                               </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate}}\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate }}\n                                                                                        </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                                          <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                                    {{ interval.name}}\n                                                                            </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVALS_AVAILABLE\' | translate }}\n                        </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n\n                                                      <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n                                         </form>\n                                       </wz-step>\n                                    <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                  </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/fax/account/view/disposition/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <!-- <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" data-ng-pattern="/^[a-zA-Z0-9]*$/" required/> -->\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$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.form.$touched && form.form.$error.pattern" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PATTERN\' | translate}}.\n        </span> -->\n      </div>\n      <!-- <div class="help-block">\n        {{\'MESSAGE_ALLOWED_NUMBERS_AND_LETTERS\' | translate}}\n                      </div> -->\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/fax/account/view/disposition/view/view.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_DISPOSITIONS\' | translate}}</span>\n                            </div>\n                                <div class="actions actions-md">\n                                      <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/fax/account/view/hooks/view/view.html",'<div class="row" data-ng-init="initView()">\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_HOOKS\' | 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_ACCEPT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_REJECT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_CLOSE\' | translate}}</a>\n                                        </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- ACCEPT TAB -->\n                                   <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.accept" data-ng-submit="forms.accept.$valid && updateItemFaxAccount()" novalidate>\n                                                          <div class="row">\n                                                                     <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid}">\n                                                                          <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                           <ui-select data-ng-model="account.acceptMethod" name="method" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                                 <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                             <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid && forms.accept.method.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <div  class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                              <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.acceptUrl"  ng-required="account.acceptMethod"/>\n                                                                           <span data-ng-show="(forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid && forms.accept.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                </div>\n                                                                <!-- START ACTIONS-->\n                                                         <div class="row" ng-repeat = "action in account.actions">\n                                                                     <div  ng-switch="action.action">\n                                                                                      <div ng-switch-when="pause">\n                                                                                          <div  class="form-group col-md-4">\n                                                                                                    <label class="control-label">{{\'APPLICATION_PAUSE\' | translate}}</label></br>\n                                                                                                               <input\n                                                                                                                bs-switch\n                                                                                                             data-ng-change="resetActionData(action)"\n                                                                                                              data-ng-model="action.enabled"\n                                                                                                                type="checkbox"\n                                                                                                               switch-active="{{ isActive }}"\n                                                                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                                          switch-on-color="{{ onColor }}"\n                                                                                                               switch-off-color="{{ offColor }}"\n                                                                                                             switch-animate="{{ animate }}"\n                                                                                                                switch-size="{{ size }}"\n                                                                                                              switch-label="{{ label }}"\n                                                                                                            switch-icon="{{ icon }}"\n                                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                                      </div>\n                                                                                                        <div ng-if="action.enabled" class="form-group col-md-8">\n                                                                                                              <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                                                             <ui-select  name="action" data-ng-model="action.type"  theme="bootstrap" >\n                                                                                                                    <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                                                       <ui-select-choices repeat=" pause.name as pause in pauses | filter: $select.search">\n                                                                                                                          <div ng-bind-html="pause.name | highlight: $select.search | uppercase" ></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                  </div>\n                                                                                        </div>\n                                                                        </div>\n                                                                        </div>\n                                                                <!-- END ACTION -->\n                                                           <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START REJECT TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.reject" data-ng-submit="forms.reject.$valid && updateItemFaxAccount()" novalidate>\n                                                  <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.rejectMethod" name="method" theme="bootstrap" >\n                                                                             <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid && forms.reject.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.rejectUrl" ng-required="account.rejectMethod"/>\n                                                                    <span data-ng-show="(forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid && forms.reject.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START CLOSE TAB -->\n                                      <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.close" data-ng-submit="forms.close.$valid && updateItemFaxAccount()" novalidate>\n                                                    <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.closeMethod" name="method" theme="bootstrap" >\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid && forms.close.method.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.closeUrl" ng-required="account.closeMethod"/>\n                                                                      <span data-ng-show="(forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid && forms.close.url.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END CLOSE TAB -->\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/fax/account/view/setting/view/view.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                                <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                                 <li>\n                                          <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_ADVANCED\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body" data-ng-init="initView()">\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 && updateItemFaxAccount()" novalidate>\n                                                        <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.$submitted || forms.general.name.$touched) && 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="account.name" required/>\n                                                                <span data-ng-show="forms.general.name.$error.required && (forms.general.$submitted || forms.general.name.$touched)" 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 HEADERINFO -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.general.$submitted || forms.general.headerinfo.$touched) && forms.general.headerinfo.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_HEADERINFO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                          <input type="text" name="headerinfo" placeholder="{{\'APPLICATION_HEADERINFO\' | translate}}" class="form-control" data-ng-model="account.headerinfo" required/>\n                                                              <span data-ng-show="forms.general.headerinfo.$error.required && (forms.general.$submitted || forms.general.headerinfo.$touched)" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span class="help-block">\n                                                                     {{\'DESCRIPTION_HEADERINFO\' | translate}}.\n                                                           </span>\n                                                       </div>\n                                                        <!-- END HEADERINFO -->\n\n                                                     <!-- START TRUNKS -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.$submitted || forms.general.trunk.$touched) && forms.general.trunk.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="account.TrunkName" name="trunk" theme="bootstrap" required>\n                                                                 <ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="trunk.name as trunk in trunks | filter: $select.search">\n                                                                           <div data-ng-bind="trunk.name | highlight: $select.search"></div>\n                                                                     </ui-select-choices>\n                                                          </ui-select>\n                                                          <div class="note note-warning" data-ng-hide="trunks.length">\n                  <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n                   </p>\n                  <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                    </p>\n                </div>\n                                                          <span data-ng-show="forms.general.trunk.$error.required && (forms.general.$submitted || forms.general.trunk.$touched)" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START TRUNKS -->\n\n                                                       <!-- START LOCALSTATIONID -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.$submitted || forms.general.localstationid.$touched) && forms.general.localstationid.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_LOCALSTATIONID\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="text" name="localstationid" placeholder="{{\'APPLICATION_LOCALSTATIONID\' | translate}}" class="form-control" data-ng-model="account.localstationid" required/>\n                                                          <span data-ng-show="forms.general.localstationid.$error.required && (forms.general.$submitted || forms.general.localstationid.$touched)" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span class="help-block">\n                                                                     {{\'DESCRIPTION_LOCALSTATIONID\' | translate}}.\n                                                               </span>\n                                                       </div>\n                                                        <!-- END LOCALSTATIONID -->\n\n                                                 <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.ListId" name="list" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.ListId = null" class="btn btn-default">\n                                                                                          <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\n\n                                                   <!-- START FIDELITY -->\n                                                       <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="account.fidelity"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END FIDELITY -->\n\n                                                       <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.general.$submitted || forms.general.timeout.$touched) && forms.general.timeout.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n                                                                <span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid && forms.general.timeout.$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.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid && forms.general.timeout.$error.number" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\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="account.description"/>\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                                    <!-- ADVANCED TAB -->\n                                 <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.advanced" data-ng-submit="forms.advanced.$valid && updateItemFaxAccount()" novalidate>\n                                                      <div class="row">\n                                                             <div class="col-md-6">\n                                                                        <!-- START ECM -->\n                                                                    <div class="form-group">\n                                                                        <label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n                                                                      <input\n                                                                          bs-switch\n                                                                     ng-model="account.ecm"\n                                                                        type="checkbox"\n                                                                       switch-active="{{ isActive }}"\n                                                                        switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                          switch-on-color="{{ onColor }}"\n                                                                       switch-off-color="{{ offColor }}"\n                                                                     switch-animate="{{ animate }}"\n                                                                        switch-size="{{ size }}"\n                                                                      switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                      switch-radio-off="{{ radioOff }}"\n                                                                     switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}"\n                                                                                   ng-true-value="\'yes\'"\n                                                                       ng-false-value="\'no\'">\n                                                                                      <span class="help-block">\n                                                                                             {{\'DESCRIPTION_ECM\' | translate}}.\n                                                                                  </span>\n                                                                       </div>\n                                                                        <!-- END ECM -->\n\n                                                                    <!-- START MINRATE -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.minrate.$touched) && forms.advanced.minrate.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_MINRATE\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="account.minrate" name="minrate" theme="bootstrap" required>\n                                                                           <ui-select-match placeholder="{{\'APPLICATION_MINRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                         <ui-select-choices repeat="minrate in rate | filter: $select.search">\n                                                                           <div data-ng-bind="minrate | highlight: $select.search"></div>\n                                                                      </ui-select-choices>\n                                                                        </ui-select>\n                                                                                <span class="help-block">\n                                                                                     {{\'DESCRIPTION_MINRATE\' | translate}}.\n                                                                              </span>\n                                                                               <span data-ng-show="forms.advanced.minrate.$error.required && (forms.advanced.$submitted || forms.advanced.minrate.$touched)" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- START MINRATE -->\n\n                                                                      <!-- START MAXRATE -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.maxrate.$touched) && forms.advanced.maxrate.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="account.maxrate" name="maxrate" theme="bootstrap" required>\n                                                                           <ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                         <ui-select-choices repeat="maxrate in rate | filter: $select.search">\n                                                                           <div data-ng-bind="maxrate | highlight: $select.search"></div>\n                                                                      </ui-select-choices>\n                                                                        </ui-select>\n                                                                                <span class="help-block">\n                                                                                     {{\'DESCRIPTION_MAXRATE\' | translate}}.\n                                                                              </span>\n                                                                               <span data-ng-show="forms.advanced.maxrate.$error.required && (forms.advanced.$submitted || forms.advanced.maxrate.$touched)" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- START MAXRATE -->\n\n                                                                      <!-- START MODEM -->\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.modem.$touched) && forms.advanced.modem.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_MODEM\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                               <input type="text" name="modem" placeholder="{{\'APPLICATION_MODEM\' | translate}}" class="form-control" data-ng-model="account.modem" required/>\n                                                                             <span class="help-block">\n                                                                                     {{\'DESCRIPTION_MODEM\' | translate}}.\n                                                                                </span>\n                                                                               <span data-ng-show="forms.advanced.modem.$error.required && (forms.advanced.$submitted || forms.advanced.modem.$touched)" class="help-block help-block-error">\n                                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END MODEM -->\n                                                            </div>\n                                                                <div class="col-md-6">\n                                                                        <!-- START GATEWAY -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.gateway.$touched) && forms.advanced.gateway.$invalid}">\n                                                                           <label class="control-label">{{\'APPLICATION_GATEWAY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                             <input type="text" name="gateway" placeholder="{{\'APPLICATION_GATEWAY\' | translate}}" class="form-control" data-ng-model="account.gateway" required data-ng-pattern="settings.patternGateway"/>\n                                                                             <span class="help-block">\n                                                                                     {{\'DESCRIPTION_GATEWAY\' | translate}}.\n                                                                              </span>\n                                                                               <span data-ng-show="(forms.advanced.gateway.$touched || forms.advanced.$submitted) && forms.advanced.gateway.$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.advanced.gateway.$touched || forms.advanced.$submitted) && forms.advanced.gateway.$error.pattern" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_GATEWAY\' | translate}}.\n                                                                                </span>\n                                                                       </div>\n                                                                        <!-- END GATEWAY -->\n\n                                                                        <!-- START FAXDETECT -->\n                                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.faxdetect.$touched) && forms.advanced.faxdetect.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_FAXDETECT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                           <input type="text" name="faxdetect" placeholder="{{\'APPLICATION_FAXDETECT\' | translate}}" class="form-control" data-ng-model="account.faxdetect" required data-ng-pattern="settings.patternFaxdetect"/>\n                                                                             <span class="help-block">\n                                                                                     {{\'DESCRIPTION_FAXDETECT\' | translate}}.\n                                                                            </span>\n                                                                               <span data-ng-show="(forms.advanced.faxdetect.$touched || forms.advanced.$submitted) && forms.advanced.faxdetect.$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.advanced.faxdetect.$touched || forms.advanced.$submitted) && forms.advanced.faxdetect.$error.pattern" class="help-block help-block-error">\n                                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_FAXDETECT\' | translate}}.\n                                                                              </span>\n                                                                       </div>\n                                                                        <!-- END FAXDETECT -->\n\n                                                                      <!-- START T38TIMEOUT -->\n                                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.t38timeout.$touched) && forms.advanced.t38timeout.$invalid}">\n                                                                             <label class="control-label">{{\'APPLICATION_T38TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input type="number" name="t38timeout" placeholder="{{\'APPLICATION_T38TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.t38timeout" required min="1000"/>\n                                                                         <span class="help-block">\n                                                                                     {{\'DESCRIPTION_T38TIMEOUT\' | translate}}.\n                                                                           </span>\n                                                                               <span data-ng-show="(forms.advanced.t38timeout.$touched || forms.advanced.$submitted) && forms.advanced.t38timeout.$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.advanced.t38timeout.$touched || forms.advanced.$submitted) && forms.advanced.t38timeout.$error.min" class="help-block help-block-error">\n                                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_T38TIMEOUT\' | translate}}.\n                                                                             </span>\n                                                                       </div>\n                                                                        <!-- END T38TIMEOUT -->\n\n                                                                     <!-- START TECH -->\n                                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.$submitted || forms.advanced.tech.$touched) && forms.advanced.tech.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_TECHNOLOGY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <ui-select data-ng-model="account.tech" name="tech" theme="bootstrap" required>\n                                                                         <ui-select-match placeholder="{{\'APPLICATION_TECHNOLOGY\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                      <ui-select-choices repeat="tech in techs | filter: $select.search">\n                                                                             <div data-ng-bind="tech | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                        </ui-select>\n                                                                                <span data-ng-show="(forms.advanced.tech.$touched || forms.advanced.$submitted) && forms.advanced.tech.$error.required" class="help-block help-block-error">\n                                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- START TECH -->\n                                                           </div>\n                                                        </div>\n\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/channels/fax/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-paper-plane"></i>\n                                      <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                                  <i class="fa fa-angle-right" data-ng-show="account"></i>\n                              </li>\n                         <li data-ng-show="account">\n                                   <a href="#">{{ account.name || account.description }}</a>\n                             </li>\n                 </ul>\n         </div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\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/account.png" class="img-responsive">\n                            </div>\n                                <!-- END SIDEBAR USERPIC -->\n\n                                <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{ account.name || account.description }}\n                                     </div>\n                                        <div class="profile-usertitle-job">\n                                           {{ account.phone }}\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.fax.accounts.view.settings\')}">\n                                                        <a href="/channels/fax/accounts/view/{{account.id}}/settings">\n                                                        <i class="icon-settings"></i>\n                                                 {{\'APPLICATION_SETTINGS\' | translate}} </a>\n                                         </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.fax.accounts.view.hooks\')}">\n                                                        <a href="/channels/fax/accounts/view/{{account.id}}/hooks">\n                                                   <i class="fa fa-code"></i>\n                                                    {{\'APPLICATION_HOOKS\' | translate}} </a>\n                                            </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.fax.accounts.view.dispositions\')}">\n                                                 <a href="/channels/fax/accounts/view/{{account.id}}/dispositions">\n                                                    <i class="icon-target"></i>\n                                                   {{\'APPLICATION_DISPOSITIONS\' | translate}} </a>\n                                             </li>\n                                         <li ng-class="{active: $state.includes(\'main.channels.fax.accounts.view.actions\')}">\n                                                        <a href="/channels/fax/accounts/view/{{account.id}}/actions/list">\n                                                    <i class="icon-directions"></i>\n                                                       {{\'APPLICATION_ACTIONS\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\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/fax/account/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\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-directions"></i>\n                                               <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-paper-plane"></i>\n                                              <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                         <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-notebook"></i>\n                                         <a href="/fax/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                                   </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_GENERAL\' | translate}}" canexit="exitValidation(forms.formGeneral.$valid)">\n                                             <form name="forms.formGeneral" novalidate>\n\n                                                  <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formGeneral.$submitted || forms.formGeneral.name.$touched) && forms.formGeneral.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.formGeneral.name.$error.required && (forms.formGeneral.$submitted || forms.formGeneral.name.$touched)" 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 HEADERINFO -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.formGeneral.$submitted || forms.formGeneral.headerinfo.$touched) && forms.formGeneral.headerinfo.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_HEADERINFO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                          <input type="text" name="headerinfo" placeholder="{{\'APPLICATION_HEADERINFO\' | translate}}" class="form-control" data-ng-model="item.headerinfo" required/>\n                                                         <span data-ng-show="forms.formGeneral.headerinfo.$error.required && (forms.formGeneral.$submitted || forms.formGeneral.headerinfo.$touched)" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span class="help-block">\n                                                                     {{\'DESCRIPTION_HEADERINFO\' | translate}}.\n                                                           </span>\n                                                       </div>\n                                                        <!-- END HEADERINFO -->\n\n                                                     <!-- START TRUNKS -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.formGeneral.$submitted || forms.formGeneral.trunk.$touched) && forms.formGeneral.trunk.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="item.TrunkName" name="trunk" theme="bootstrap" required>\n                                                                    <ui-select-match placeholder="{{\'APPLICATION_TRUNK\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="trunk.name as trunk in trunks | filter: $select.search">\n                                                                           <div data-ng-bind="trunk.name | highlight: $select.search"></div>\n                                                                     </ui-select-choices>\n                                                          </ui-select>\n                                                          <div class="note note-warning" data-ng-hide="trunks.length">\n                  <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n                   </p>\n                  <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                    </p>\n                </div>\n                                                          <span data-ng-show="forms.formGeneral.trunk.$error.required && (forms.formGeneral.$submitted || forms.formGeneral.trunk.$touched)" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START TRUNKS -->\n\n                                                       <!-- START LOCALSTATIONID -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.formGeneral.$submitted || forms.formGeneral.localstationid.$touched) && forms.formGeneral.localstationid.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_LOCALSTATIONID\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="text" name="localstationid" placeholder="{{\'APPLICATION_LOCALSTATIONID\' | translate}}" class="form-control" data-ng-model="item.localstationid" required/>\n                                                             <span data-ng-show="forms.formGeneral.localstationid.$error.required && (forms.formGeneral.$submitted || forms.formGeneral.localstationid.$touched)" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span class="help-block">\n                                                                     {{\'DESCRIPTION_LOCALSTATIONID\' | translate}}.\n                                                               </span>\n                                                       </div>\n                                                        <!-- END LOCALSTATIONID -->\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                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n                                               </form>\n                                       </wz-step>\n\n                                  <wz-step title="{{\'APPLICATION_ADVANCED\' | translate}}" canexit="exitValidation(forms.formAdvanced.$valid)">\n                                                <form name="forms.formAdvanced" novalidate>\n\n                                                 <!-- START ECM -->\n                                                    <div class="form-group">\n                                                        <label class="control-label">{{\'APPLICATION_ECM\' | translate}}<span class="required" aria-required="true">*</span></label><br>\n                                                      <input\n                                                          bs-switch\n                                                     ng-model="item.ecm"\n                                                           type="checkbox"\n                                                       switch-active="{{ isActive }}"\n                                                        switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                       switch-off-color="{{ offColor }}"\n                                                     switch-animate="{{ animate }}"\n                                                        switch-size="{{ size }}"\n                                                      switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                      switch-radio-off="{{ radioOff }}"\n                                                     switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}"\n                                                                   ng-true-value="\'yes\'"\n                                                       ng-false-value="\'no\'">\n                                                                      <span class="help-block">\n                                                                             {{\'DESCRIPTION_ECM\' | translate}}.\n                                                                  </span>\n                                                       </div>\n                                                        <!-- END ECM -->\n\n                                                    <!-- START MINRATE -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.minrate.$touched) && forms.formAdvanced.minrate.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_MINRATE\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="item.minrate" name="minrate" theme="bootstrap" required>\n                                                      <ui-select-match placeholder="{{\'APPLICATION_MINRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                         <ui-select-choices repeat="minrate in rate | filter: $select.search">\n                                                           <div data-ng-bind="minrate | highlight: $select.search"></div>\n                                                      </ui-select-choices>\n                                                        </ui-select>\n                                                                <span class="help-block">\n                                                                     {{\'DESCRIPTION_MINRATE\' | translate}}.\n                                                              </span>\n                                                               <span data-ng-show="forms.formAdvanced.minrate.$error.required && (forms.formAdvanced.$submitted || forms.formAdvanced.minrate.$touched)" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START MINRATE -->\n\n                                                      <!-- START MAXRATE -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.maxrate.$touched) && forms.formAdvanced.maxrate.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_MAXRATE\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="item.maxrate" name="maxrate" theme="bootstrap" required>\n                                                      <ui-select-match placeholder="{{\'APPLICATION_MAXRATE\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                         <ui-select-choices repeat="maxrate in rate | filter: $select.search">\n                                                           <div data-ng-bind="maxrate | highlight: $select.search"></div>\n                                                      </ui-select-choices>\n                                                        </ui-select>\n                                                                <span class="help-block">\n                                                                     {{\'DESCRIPTION_MAXRATE\' | translate}}.\n                                                              </span>\n                                                               <span data-ng-show="forms.formAdvanced.maxrate.$error.required && (forms.formAdvanced.$submitted || forms.formAdvanced.maxrate.$touched)" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START MAXRATE -->\n\n                                                      <!-- START MODEM -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.modem.$touched) && forms.formAdvanced.modem.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_MODEM\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                               <input type="text" name="modem" placeholder="{{\'APPLICATION_MODEM\' | translate}}" class="form-control" data-ng-model="item.modem" required/>\n                                                                <span class="help-block">\n                                                                     {{\'DESCRIPTION_MODEM\' | translate}}.\n                                                                </span>\n                                                               <span data-ng-show="forms.formAdvanced.modem.$error.required && (forms.formAdvanced.$submitted || forms.formAdvanced.modem.$touched)" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MODEM -->\n\n                                                  <!-- START GATEWAY -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.gateway.$touched) && forms.formAdvanced.gateway.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_GATEWAY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="gateway" placeholder="{{\'APPLICATION_GATEWAY\' | translate}}" class="form-control" data-ng-model="item.gateway" required data-ng-pattern="settings.patternGateway"/>\n                                                                <span class="help-block">\n                                                                     {{\'DESCRIPTION_GATEWAY\' | translate}}.\n                                                              </span>\n                                                               <span data-ng-show="(forms.formAdvanced.gateway.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.gateway.$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.formAdvanced.gateway.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.gateway.$error.pattern" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_GATEWAY\' | translate}}.\n                                                                </span>\n                                                       </div>\n                                                        <!-- END GATEWAY -->\n\n                                                        <!-- START FAXDETECT -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.faxdetect.$touched) && forms.formAdvanced.faxdetect.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_FAXDETECT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                           <input type="text" name="faxdetect" placeholder="{{\'APPLICATION_FAXDETECT\' | translate}}" class="form-control" data-ng-model="item.faxdetect" required data-ng-pattern="settings.patternFaxdetect"/>\n                                                                <span class="help-block">\n                                                                     {{\'DESCRIPTION_FAXDETECT\' | translate}}.\n                                                            </span>\n                                                               <span data-ng-show="(forms.formAdvanced.faxdetect.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.faxdetect.$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.formAdvanced.faxdetect.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.faxdetect.$error.pattern" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_PATTERN_FAXDETECT\' | translate}}.\n                                                              </span>\n                                                       </div>\n                                                        <!-- END FAXDETECT -->\n\n                                                      <!-- START T38TIMEOUT -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.t38timeout.$touched) && forms.formAdvanced.t38timeout.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_T38TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                          <input type="number" name="t38timeout" placeholder="{{\'APPLICATION_T38TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.t38timeout" required min="1000"/>\n                                                            <span class="help-block">\n                                                                     {{\'DESCRIPTION_T38TIMEOUT\' | translate}}.\n                                                           </span>\n                                                               <span data-ng-show="(forms.formAdvanced.t38timeout.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.t38timeout.$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.formAdvanced.t38timeout.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.t38timeout.$error.min" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_INVALID_T38TIMEOUT\' | translate}}.\n                                                             </span>\n                                                       </div>\n                                                        <!-- END T38TIMEOUT -->\n\n                                                     <!-- START TECH -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formAdvanced.$submitted || forms.formAdvanced.tech.$touched) && forms.formAdvanced.tech.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_TECHNOLOGY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                          <ui-select data-ng-model="item.tech" name="tech" theme="bootstrap" required>\n                                                            <ui-select-match placeholder="{{\'APPLICATION_TECHNOLOGY\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                      <ui-select-choices repeat="tech in techs | filter: $select.search">\n                                                             <div data-ng-bind="tech | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                        </ui-select>\n                                                                <span data-ng-show="(forms.formAdvanced.tech.$touched || forms.formAdvanced.$submitted) && forms.formAdvanced.tech.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START TECH -->\n\n                                                 <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                     <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n                                               </form>\n                                       </wz-step>\n\n                                  <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                             <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                 </wz-step>\n\n                          </wizard>\n\n                   </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/fax/inbox/message/info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body"  data-ng-init="initInfo()">\n  <div class="form-group" ng-if="data">\n    <json-formatter json="data" open="1"></json-formatter>\n  </div>\n  <div class="note note-warning" data-ng-hide="data">\n    <h4 class="block"></h4>\n    <p>\n      {{ \'MESSAGE_NO_INFO_AVAILABLE\' | translate }}\n    </p>\n  </div>\n\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/channels/fax/inbox/message/message.directive.html",'<div class="message">\n  <div class="row">\n    <div class="col-md-6">\n      <span class="bold">From: </span>\n      [<a href="" data-ng-click="openContact(message.from)">{{message.from}}</a>]\n      <br>\n      <span class="bold">To: </span>\n      [<a href="" data-ng-click="openContact(message.to)">{{message.to}}</a>]\n    </div>\n    <div class="col-md-6">\n      <span class="pull-right">\n        <a ng-click="info(message)"><i class="icon-info font-blue"></i></a>\n      </span>\n      <span class="pull-right" data-ng-show="message.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{message.User.fullname}}</strong></span>\n    </div>\n  </div>\n  <br>\n  <span class="todo-tasklist-date">\n    <span class="pull-right" data-ng-if="message.status!==\'RECEIVED\'" data-ng-switch="message.status" uib-tooltip="{{\'APPLICATION_PAGE_TRANSFERRED\' | translate}}: {{message.pagestransferred}} - {{\'APPLICATION_RETRY\' | translate}}: {{message.retry}}">\n      <a ng-switch-when="SENDING" href="#" class="btn default btn-xs inactive-link blue-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-warning"></i>\n      </a>\n      <a ng-switch-when="FAILED" href="#" class="btn default btn-xs red-stripe" data-ng-click="retry(message.id)"> {{message.status | uppercase}}\n        <i class="fa fa-times"></i>\n      </a>\n      <a ng-switch-when="SENT" href="#" class="btn default btn-xs inactive-link green-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n    </span>\n    <span class="pull-right" data-ng-if="message.status===\'RECEIVED\'" uib-tooltip="{{\'APPLICATION_PAGE_TRANSFERRED\' | translate}}: {{message.pagestransferred}}">\n      <a href="#" class="btn default btn-xs inactive-link green-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n    </span>\n    <i class="icon-calendar"></i> <span am-time-ago="message.updatedAt"></span>\n  </span>\n  <hr data-ng-if="message.FaxAttachments.length">\n  <div data-ng-repeat="faxAttachment in message.FaxAttachments">\n    <strong>{{faxAttachment.name}}</strong>\n    <a target="_self" download="{{faxAttachment.name}}" href="api/fax/attachments/{{faxAttachment.id}}">\n      <i class="icon-cloud-download"></i>\n    </a>\n  </div>\n</div>\n'),a.put("app/channels/fax/inbox/note/note.directive.html",'<div class="note">\n  <div class="row">\n    <div class="col-md-6">\n      <a type="button" name="button" data-ng-if="::(Auth.getCurrentUser().id == message.UserId)" data-ng-click="deleteNote()">\n        <i class="fa fa-trash-o" style="color: red;"></i>\n      </a>\n\n      <i class="icon-calendar"></i> <span am-time-ago="message.updatedAt"></span>\n    </div>\n    <div class="col-md-6">\n      <span class="pull-right" data-ng-show="message.User">{{\'APPLICATION_ADD_BY\' | translate}}: <strong>{{message.User.fullname}}</strong></span>\n    </div>\n  </div>\n  <hr>\n  <span class="body text-left" data-ng-bind-html="message.text" style="white-space: pre-wrap;"></span>\n</div>\n'),a.put("app/channels/fax/inbox/note/note.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_NOTES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <div class="form-group">\n      <textarea data-ng-model="item.text" name="text" rows="10" style="resize: none; width: 100%;"></textarea>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/inbox/room/room.directive.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content" data-ng-init="initForm();">\n      <div class="portlet light">\n           <div class="portlet-title">\n                   <div class="caption">\n                         <button data-ng-if="(!forms.compose.from.$invalid && !forms.compose.to.$invalid && uploader.queue.length) && faxRoom.status !== \'CLOSED\'" class="btn btn-sm btn-default green-meadow" data-ng-click="sendFax()">\n                                    <i class="icon-paper-plane" style="color: white;"></i> {{\'APPLICATION_SEND\' | translate}}\n                           </button>\n                             <span data-ng-if="(!forms.compose.from.$invalid && !forms.compose.to.$invalid && uploader.queue.length) && faxRoom && faxRoom.status !== \'CLOSED\'"> | </span>\n                               <span data-ng-if="faxRoom" class="label label-default"> #{{faxRoom.id}} {{faxRoom.status}}</span>\n                             <span data-ng-if="faxRoom"> | </span>\n                         <span data-ng-if="faxRoom" class="caption-subject font-green-sharp bold">{{faxRoom.contact}}</span>\n                   </div>\n                        <div class="actions" data-ng-switch="faxRoom.status">\n                         <button class="btn btn-icon-only yellow" data-ng-if="faxRoom" data-ng-click="loadNote()" data-ng-hide="faxRoom.status == \'CLOSED\'" title="{{\'APPLICATION_NOTES\' | translate}}">\n                                   <i class="fa fa-sticky-note"></i>\n                             </button>\n                             <button class="file-upload" data-ng-hide="faxRoom.status == \'CLOSED\'">\n                                      <i class="fa fa-paperclip"></i> <input type="file" data-ng-if="uploader" data-ng-hide="faxRoom.status == \'CLOSED\'" nv-file-select uploader="uploader" multiple class="file-input" title="{{\'APPLICATION_ATTACHMENTS\' | translate}}">\n                              </button>\n                             <!-- UPDATE SECTION START -->\n                         <button data-ng-class="faxRoom.status == \'CLOSED\' ? \'grey-cascade\' : \'btn-success\'" class="btn btn-icon-only" data-ng-hide="faxRoom.status == \'CLOSED\' && faxRoom.disposition" data-ng-if="faxRoom" data-ng-click="closeRoom()" title="{{\'APPLICATION_STATUS\' | translate}}">\n                                       <i data-ng-class="faxRoom.status == \'CLOSED\' ? \'icon-target\' : \'fa fa-upload\'"></i>\n                             </button>\n                             <!-- UPDATE SECTION END -->\n                           <button class="btn default btn-icon-only" data-ng-if="faxRoom && faxRoom.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-show="panelLeft" data-ng-class="panelLeft">\n                                      <div class="form">\n                                            <!-- START TAGS -->\n                                           <div class="form-group" data-ng-if="faxRoom.status !== \'CLOSED\'">\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($item, $model)" on-remove="onChanged($item, $model)" data-ng-disabled="faxRoom.status == \'CLOSED\'">\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\n                                      <hr data-ng-if="faxRoom && faxRoom.status !== \'CLOSED\'">\n\n                                  <!-- END TAGS -->\n\n                                   <div id="mail-box">\n                                           <ul class="chats">\n                                                    <li\n                                                   data-ng-switch="faxMessage.status"\n                                                    data-ng-class="{\'in\': faxMessage.status == \'RECEIVED\', \'out\': faxMessage.status == \'SENT\' || faxMessage.status == \'SENDING\' || faxMessage.status == \'FAILED\' || faxMessage.status == \'NOTE\'}"\n                                                   data-ng-repeat="faxMessage in faxRoom.FaxMessages | orderBy:\'-createdAt\'">\n                                                          <div class="avatar" data-ng-class="faxMessage.UserId ? \'pretty-avatar\' : \'pretty-avatar-v\'">\n                                                              <ng-letter-avatar\n                                                             data-ng-if="faxMessage.UserId"\n                                                                height="40"\n                                                           width="40"\n                                                            fontsize="25"\n                                                         data="{{faxMessage.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="!faxMessage.UserId"\n                                                               height="40"\n                                                           width="40"\n                                                            fontsize="25"\n                                                         data="{{faxMessage.from}}"\n                                                            avatarcustombgcolor="#B0B0B0"\n                                                         avatarcustomborder="border:2px solid #EA4C61"\n                                                         charCount="1"\n                                                         shape="round"></ng-letter-avatar>\n                                                     </div>\n                                                                <fax-note message="faxMessage" ng-switch-when="NOTE"></fax-note>\n                                                              <fax-message message="faxMessage" list-id="faxRoom.FaxAccount.ListId" ng-switch-default></fax-message>\n                                                        </li>\n                                         </ul>\n                                 </div>\n                                </div>\n                                <div data-ng-class="panelRight">\n                                      <div class="note note-info" data-ng-if="faxRoom && faxRoom.status == \'CLOSED\'">\n                                             <h4 class="block"><i class="icon-info"></i> {{\'MESSAGE_FAX_ROOM_CLOSED\' | translate}}!</h4>\n                                         <p>\n                                                   <strong>{{\'MESSAGE_FAX_ROOM_CLOSED_DETAILS\' | translate}}.</strong>\n                                         </p>\n                                          <hr>\n                                          <p>\n                                                   <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{faxRoom.disposition}}</strong>\n                                             </p>\n                                          <p>\n                                                   <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{faxRoom.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="faxRoom.updatedAt"></span>)\n                                            </p>\n                                  </div>\n                                        <form name="forms.compose" data-ng-submit="sendFax()" class="form-horizontal" novalidate>\n\n                                           <!-- START HEAD -->\n                                           <div class="form">\n\n                                                  <v-accordion class="vAccordion--default" ng-if="faxRoom.status !== \'CLOSED\'">\n                                                         <v-pane expanded="expanded">\n                                                            <v-pane-header>\n                                                         <i class="icon-people"></i> From: {{form.from}}, To: {{form.to[0].fax}}\n                                                     </v-pane-header>\n                                                      <v-pane-content>\n                                                                          <!-- START FROM -->\n                                                         <div class="form-group" data-ng-if="faxRoom.status !== \'CLOSED\'" data-ng-class="{\'has-error\': forms.compose.from.$invalid}">\n                                                                <div class="col-md-12">\n                                                                 <div class="row">\n                                                               <div class="col-md-1">\n                                                                  <label class="control-label">From:</label>\n                                                                  </div>\n                                                                <div class="col-md-11">\n                                                                 <ui-select data-ng-model="form.from" data-ng-change="setList($select.selected.ListId)" theme="bootstrap" name="from" required>\n                                                                  <ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n                                                                    <ui-select-choices repeat="faxAccount.localstationid as faxAccount in faxAccounts | filter: $select.search">\n                                                                    <div data-ng-bind-html="faxAccount.name | highlight: $select.search"></div>\n                                                                   <small data-ng-bind-html="faxAccount.localstationid | highlight: $select.search"></small>\n                                                                   </ui-select-choices>\n                                                                </ui-select>\n                                                                                                            <span data-ng-show="forms.compose.from.$invalid" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                               </span>\n                                                             </div>\n                                                              </div>\n                                                              </div>\n                                                              </div>\n                                                        <!-- END FROM -->\n\n                                                                             <!-- START TO -->\n                                                           <div class="form-group" data-ng-if="faxRoom.status !== \'CLOSED\'" data-ng-class="{\'has-error\': forms.compose.to.$invalid}">\n                                                          <div class="col-md-12">\n                                                                 <div class="row">\n                                                               <div class="col-md-1">\n                                                                  <label class="control-label">To:</label>\n                                                                    </div>\n                                                                <div class="col-md-11">\n                                                                 <tags-input name="to" ng-model="form.to" type="text" display-property="fax" max-tags="1" min-tags="1">\n                                                                  <auto-complete source="getContacts($query)"></auto-complete>\n                                                                </tags-input>\n                                                                 <span data-ng-show="forms.compose.to.$invalid" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_TO_LIMIT\' | translate}}.\n                                                                     </span>\n                                                             </div>\n                                                              </div>\n                                                              </div>\n                                                              </div>\n                                                        <!-- END TO -->\n\n                                                           </v-pane-content>\n                                                   </v-pane>\n                                                   </v-accordion>\n\n                                                      <!-- START ATTACH -->\n                                                 <div class="form-group" data-ng-if="uploader  && (faxRoom.status !== \'CLOSED\')">\n                                                            <div class="col-md-12">\n                                                                       <hr ng-if="uploader.queue.length">\n                                                                    <table class="table">\n                                                                         <tbody>\n                                                                                       <tr ng-repeat="item in uploader.queue">\n                                                                                               <td style="border-top:none"><strong>{{ item.file.name | truncate: 5: \'...\': true}}</strong></td>\n                                                                                            <td style="border-top:none" ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n                                                                                         <td style="border-top:none" ng-show="uploader.isHTML5">\n                                                                                                       <div class="progress" style="margin-bottom: 0;">\n                                                                                                              <div class="progress-bar" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n                                                                                                   </div>\n                                                                                                </td>\n                                                                                         <td style="border-top-style:none" class="text-center">\n                                                                                                        <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>\n                                                                                                  <span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>\n                                                                                                   <span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>\n                                                                                                </td>\n                                                                                         <td style="border-top-style:none" nowrap>\n                                                                                                     <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n                                                                                                            <span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n                                                                                                        </button>\n                                                                                             </td>\n                                                                                 </tr>\n                                                                         </tbody>\n                                                                      </table>\n                                                                      <div>\n                                                                 </div>\n                                                                </div>\n                                                        </div>\n                                                        <!-- END ATTACH -->\n\n                                         </div>\n                                        </form>\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n<!-- END TODO CONTENT -->\n'),
-a.put("app/channels/fax/inbox/status/status.modal.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 data-ng-if="modal.title" data-ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-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="disposition" 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-if="dispositions.length < 1">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate }}\n      </p>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\n                  <a href="#" class="btn btn-icon-only btn-success" data-ng-click="disposeItems();" data-ng-show="id.length">\n                           <i class="fa fa-upload"></i>\n                  </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></span>\n              <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid-inbox">\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'),a.put("app/channels/fax/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n        <div class="note note-warning" data-ng-hide="agents">\n          <h4 class="block">Warning!</h4>\n          <p>\n            {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n          </p>\n          <p>\n            {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_AGENTS\' | translate}}</a>\n          </p>\n        </div>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/inbox/view/view.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-directions"></i>\n          <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-paper-plane"></i>\n          <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n                                <li>\n                                  <i class="icon-note"></i>\n                                     <a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n        </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox">\n <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == faxAccount.id}" data-ng-repeat="faxAccount in faxAccounts">\n                            <a href="/channels/fax/inbox/view/account/{{faxAccount.id}}/list" class="btn">\n                                        <i class="icon-notebook"></i> {{faxAccount.name}}\n                             </a>\n                          <b></b>\n                       </li>\n         </ul>\n    <div class="note note-warning" data-ng-hide="faxAccounts.length">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_AVAILABLE_ACCOUNTS\' | translate }}\n      </p>\n      <p>\n        {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/fax/accounts/list">{{\'APPLICATION_ACCOUNTS\' | translate}}</a>\n      </p>\n    </div>\n  </div>\n\n      <div class="col-md-9" data-ng-init="initView()">\n              <!-- BEGIN PROFILE CONTENT -->\n                <div class="room-content">\n                    <div ui-view>\n                         <div class="note note-info">\n                                  <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                              </div>\n                        </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n'),a.put("app/channels/fax/inbox/view/view.status.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ modal.title | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p data-ng-if="modal.text" data-ng-bind="modal.text"></p>\n  <div data-ng-if="modal.html" data-ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button data-ng-repeat="button in modal.buttons"\n  data-ng-class="button.classes"\n  data-ng-click="button.click($event)"\n  data-ng-bind="button.text | translate" class="btn"></button>\n</div>\n'),a.put("app/channels/fax/inbox/view/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'),a.put("app/channels/fax/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 strategies | filter: $select.search">\n          <div ng-bind-html="strategy | uppercase | 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/fax/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-directions"></i>\n                                               <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-paper-plane"></i>\n                                              <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                         <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-docs"></i>\n                                             <a href="/channels/fax/queues/lis">{{ \'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/fax/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/fax/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-paper-plane"></i>\n                                      <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/fax/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 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.channels.fax.queues.view.settings\')}">\n                                                  <a data-ng-href="/channels/fax/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.fax.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/fax/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/fax/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 && updateFaxQueue()" 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 strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | 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_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/fax/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/fax/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/fax/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/fax/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/fax/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-paper-plane"></i>\n                                      <a href="#">{{ \'APPLICATION_FAX\' | 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.fax.realtime.view.agents\')}">\n                                                      <a href="/channels/fax/realtime/view/agents">\n                                                         {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.fax.realtime.view.applications\')}">\n                                                        <a href="/channels/fax/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/mail/account/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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="#">{{ \'APPLICATION_ACCOUNTS\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" href="/channels/mail/accounts/wizard">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | 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/mail/account/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/mail/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n                                                 <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),
+a.put("app/channels/fax/inbox/status/status.modal.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 data-ng-if="modal.title" data-ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-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="disposition" 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-if="dispositions.length < 1">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate }}\n      </p>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\n                  <a href="#" class="btn btn-icon-only btn-success" data-ng-click="disposeItems();" data-ng-show="id.length">\n                           <i class="fa fa-upload"></i>\n                  </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></span>\n              <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter class="ui-grid-inbox">\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'),a.put("app/channels/fax/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n        <div class="note note-warning" data-ng-hide="agents">\n          <h4 class="block">Warning!</h4>\n          <p>\n            {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n          </p>\n          <p>\n            {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_AGENTS\' | translate}}</a>\n          </p>\n        </div>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/fax/inbox/view/view.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-directions"></i>\n          <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n          <i class="icon-paper-plane"></i>\n          <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n                                <li>\n                                  <i class="icon-note"></i>\n                                     <a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n        </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox">\n <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == faxAccount.id}" data-ng-repeat="faxAccount in faxAccounts">\n                            <a href="/channels/fax/inbox/view/account/{{faxAccount.id}}/list" class="btn">\n                                        <i class="icon-notebook"></i> {{faxAccount.name}}\n                             </a>\n                          <b></b>\n                       </li>\n         </ul>\n    <div class="note note-warning" data-ng-hide="faxAccounts.length">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_AVAILABLE_ACCOUNTS\' | translate }}\n      </p>\n      <p>\n        {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/fax/accounts/list">{{\'APPLICATION_ACCOUNTS\' | translate}}</a>\n      </p>\n    </div>\n  </div>\n\n      <div class="col-md-9" data-ng-init="initView()">\n              <!-- BEGIN PROFILE CONTENT -->\n                <div class="room-content">\n                    <div ui-view>\n                         <div class="note note-info">\n                                  <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                              </div>\n                        </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n'),a.put("app/channels/fax/inbox/view/view.status.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ modal.title | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p data-ng-if="modal.text" data-ng-bind="modal.text"></p>\n  <div data-ng-if="modal.html" data-ng-bind-html="modal.html"></div>\n</div>\n<div class="modal-footer">\n  <button data-ng-repeat="button in modal.buttons"\n  data-ng-class="button.classes"\n  data-ng-click="button.click($event)"\n  data-ng-bind="button.text | translate" class="btn"></button>\n</div>\n'),a.put("app/channels/fax/inbox/view/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'),a.put("app/channels/fax/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 strategies | filter: $select.search">\n          <div ng-bind-html="strategy | uppercase | 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/fax/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-directions"></i>\n                                               <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                            <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-paper-plane"></i>\n                                              <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                         <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="icon-docs"></i>\n                                             <a href="/channels/fax/queues/lis">{{ \'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-show="Auth.getCurrentUser().role === \'admin\'">\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/fax/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/fax/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-paper-plane"></i>\n                                      <a href="#">{{ \'APPLICATION_FAX\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/fax/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 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.channels.fax.queues.view.settings\')}">\n                                                  <a data-ng-href="/channels/fax/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.fax.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/fax/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/fax/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 && updateFaxQueue()" 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 strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | 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_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/fax/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/fax/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/fax/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/fax/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/fax/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-paper-plane"></i>\n                                      <a href="#">{{ \'APPLICATION_FAX\' | 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.fax.realtime.view.agents\')}">\n                                                      <a href="/channels/fax/realtime/view/agents">\n                                                         {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.fax.realtime.view.applications\')}">\n                                                        <a href="/channels/fax/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/mail/account/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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="#">{{ \'APPLICATION_ACCOUNTS\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" href="/channels/mail/accounts/wizard">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | 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/mail/account/view/action/list/list.html",'<div class="row" data-ng-init="initActons()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/mail/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n                                                 <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),
 a.put("app/channels/mail/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n        <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.settings" ng-submit="updateItem()" novalidate>\n                                      <!-- START APP -->\n                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                       </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END APP -->\n\n                                    <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                          <!-- START QUEUE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n                                                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/mail/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END QUEUE -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                          <!-- START AGENT -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_AGENTS\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END AGENT -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                          <!-- START SENDMAIL -->\n                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                 <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                  <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                      <span data-ng-show="(forms.action.from.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END SENDMAIL -->\n                                 </div>\n\n\n                                    <div class="app-settings" ng-slide-down="application.app === \'replyMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                         <!-- START REPLYMAIL -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.type.$touched || forms.action.$submitted) && forms.action.type.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                 <ui-select data-ng-model="application.data1" name="type" theme="bootstrap" required>\n                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.key | translate }}</ui-select-match>\n                                                          <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                     <div ng-bind-html="type.key | translate | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.action.type.$touched || forms.action.$submitted) && forms.action.type.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END REPLYMAIL -->\n                                        </div>\n\n                                      <!-- START INTERVAL_TYPE -->\n                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n                                           <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                               {{ intType.name | translate }}\n                                                        </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END INTERVAL_TYPE -->\n\n                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                <!-- START TIME -->\n                                           <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                   <div class="input-group input-large">\n                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                             </fieldset>\n                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                     </div>\n                                                </div>\n                                                <!-- END TIME -->\n\n                                           <!-- START ALWAYS -->\n                                         <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                 <div class="input-group input-large">\n                                                         <label class="control-label pointer-cursor">\n                                                                  <input\n                                                                                bs-switch\n                                                                             data-ng-model="application.alwaysTime"\n                                                                                type="checkbox"\n                                                                               switch-active="{{ isActive }}"\n                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                switch-on-color="{{ onColor }}"\n                                                                               switch-off-color="{{ offColor }}"\n                                                                             switch-animate="{{ animate }}"\n                                                                                switch-size="{{ size }}"\n                                                                              switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                              switch-radio-off="{{ radioOff }}"\n                                                                             switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}">\n                                                              </label>\n                                                      </div>\n                                                </div>\n                                                <!-- END ALWAYS -->\n\n                                         <!-- START WEEKDAY -->\n                                                <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                        <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END WEEKDAY -->\n\n                                                <!-- START MONTHDAY -->\n                                               <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                       <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTHDAY -->\n\n                                               <!-- START MONTH -->\n                                          <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                  <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTH -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                          <!-- START INTERVALS -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                    {{ interval.name}}\n                                                            </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                                                               <h4 class="block">Warning!</h4>\n                                                               <p>\n                                                                   {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                                                           </p>\n                                                          <p>\n                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                                                           </p>\n                                                  </div>\n                                                        <span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVALS -->\n\n                                      </div>\n                                        <button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n                          </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/account/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n        <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n\n                                         <form name="forms.action" novalidate>\n                                                 <!-- START APP -->\n                                                    <div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n                                                               <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APP -->\n\n                                                    <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                                          <!-- START AGENT -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_AGENTS\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END AGENT -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                        </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                                          <!-- START QUEUE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.MailQueueId" name="queue" theme="bootstrap" required>\n                                                                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/mail/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                  </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                                          <!-- START SENDMAIL -->\n                                                               <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1">\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                         <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                                              <span data-ng-show="(forms.action.from.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.timeout.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END SENDMAIL -->\n                                                 </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'replyMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                                         <!-- START REPLYMAIL -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.type.$touched || forms.action.$submitted) && forms.action.type.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                 <ui-select data-ng-model="application.data1" name="type" theme="bootstrap" required>\n                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.key | translate }}</ui-select-match>\n                                                                          <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.key | translate | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.type.$touched || forms.action.$submitted) && forms.action.type.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END REPLYMAIL -->\n                                                        </div>\n\n\n                                                    <!-- START INTERVAL_TYPE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n                                                         <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                               {{ intType.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVAL_TYPE -->\n\n                                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                             </fieldset>\n                                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                     </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                        bs-switch\n                                                                                     data-ng-model="application.alwaysTime"\n                                                                                        type="checkbox"\n                                                                                       switch-active="{{ isActive }}"\n                                                                                        switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                        switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                        switch-on-color="{{ onColor }}"\n                                                                                       switch-off-color="{{ offColor }}"\n                                                                                     switch-animate="{{ animate }}"\n                                                                                        switch-size="{{ size }}"\n                                                                                      switch-label="{{ label }}"\n                                                                                    switch-icon="{{ icon }}"\n                                                                                      switch-radio-off="{{ radioOff }}"\n                                                                                     switch-label-width="{{ labelWidth }}"\n                                                                                 switch-handle-width="{{ handleWidth }}">\n                                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                                               </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate}}\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate }}\n                                                                                        </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                                          <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                                    {{ interval.name}}\n                                                                            </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                         </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n\n                                                      <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n\n                                               </form>\n                                       </wz-step>\n                                    <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                  </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/mail/account/view/disposition/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <!-- <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" data-ng-pattern="/^[a-zA-Z0-9]*$/" required/> -->\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$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.form.$touched && form.form.$error.pattern" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_WRONG_PATTERN\' | translate}}.\n        </span> -->\n      </div>\n      <!-- <div class="help-block">\n        {{\'MESSAGE_ALLOWED_NUMBERS_AND_LETTERS\' | translate}}\n                     </div> -->\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/mail/account/view/disposition/view/view.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_DISPOSITIONS\' | translate}}</span>\n                            </div>\n                                <div class="actions actions-md">\n                                      <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/mail/account/view/hooks/view/view.html",'<div class="row" data-ng-init="initView()">\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_HOOKS\' | 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_ACCEPT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_REJECT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_CLOSE\' | translate}}</a>\n                                        </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- ACCEPT TAB -->\n                                   <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.accept" data-ng-submit="forms.accept.$valid && updateItemMailAccount()" novalidate>\n                                                         <div class="row">\n                                                                     <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid}">\n                                                                          <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                           <ui-select data-ng-model="account.acceptMethod" name="method" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                                 <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                             <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid && forms.accept.method.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <div  class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                              <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.acceptUrl"  ng-required="account.acceptMethod"/>\n                                                                           <span data-ng-show="(forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid && forms.accept.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                </div>\n                                                                <div class="row" ng-repeat = "action in account.actions">\n                                                                     <div  ng-switch="action.action">\n                                                                                      <div ng-switch-when="pause">\n                                                                                          <div  class="form-group col-md-4">\n                                                                                                    <label class="control-label">{{\'APPLICATION_PAUSE\' | translate}}</label></br>\n                                                                                                               <input\n                                                                                                                bs-switch\n                                                                                                             data-ng-change="resetActionData(action)"\n                                                                                                              data-ng-model="action.enabled"\n                                                                                                                type="checkbox"\n                                                                                                               switch-active="{{ isActive }}"\n                                                                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                                          switch-on-color="{{ onColor }}"\n                                                                                                               switch-off-color="{{ offColor }}"\n                                                                                                             switch-animate="{{ animate }}"\n                                                                                                                switch-size="{{ size }}"\n                                                                                                              switch-label="{{ label }}"\n                                                                                                            switch-icon="{{ icon }}"\n                                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                                      </div>\n                                                                                                        <div ng-if="action.enabled" class="form-group col-md-8">\n                                                                                                              <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                                                             <ui-select  name="action" data-ng-model="action.type"  theme="bootstrap" >\n                                                                                                                    <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                                                       <ui-select-choices repeat=" pause.name as pause in pauses | filter: $select.search">\n                                                                                                                          <div ng-bind-html="pause.name | highlight: $select.search | uppercase" ></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                  </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START REJECT TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.reject" data-ng-submit="forms.reject.$valid && updateItemMailAccount()" novalidate>\n                                                 <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.rejectMethod" name="method" theme="bootstrap" >\n                                                                             <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid && forms.reject.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.rejectUrl" ng-required="account.rejectMethod"/>\n                                                                    <span data-ng-show="(forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid && forms.reject.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END REJECT TAB -->\n                                       <!-- START CLOSE TAB -->\n                                      <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.close" data-ng-submit="forms.close.$valid && updateItemMailAccount()" novalidate>\n                                                   <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.closeMethod" name="method" theme="bootstrap" >\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid && forms.close.method.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.closeUrl" ng-required="account.closeMethod"/>\n                                                                      <span data-ng-show="(forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid && forms.close.url.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END CLOSE TAB -->\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/mail/account/view/other/view/view.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_OTHER\' | 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_GENERALS\' | translate}}</a>\n                                     </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_SIGNATURE\' | translate}}</a>\n                                    </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <!-- BEGIN UI-GRID SPINNER -->\n                                <span us-spinner spinner-key="mail-spinner-grid" spinner-start-active="false"></span>\n                         <!-- END UI-GRID SPINNER -->\n\n                                <div class="tab-content">\n                                     <!-- GENERAL TAB -->\n                                  <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.info" data-ng-submit="forms.info.$valid && updateItemMailAccount()" novalidate>\n                                                     <!-- START WHITE LABEL -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.info.whiteLabel.$touched || forms.info.$submitted) && forms.info.whiteLabel.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_WHITE_LABEL\' | translate}}</label>\n                                                              <textarea type="text" name="whiteLabel" placeholder="{{\'APPLICATION_WHITE_LABEL\' | translate}}" class="form-control" data-ng-model="account.whiteLabel" data-ng-disabled="!license.custom"/></textarea>\n                                                             <span data-ng-show="(forms.info.whiteLabel.$touched || forms.info.$submitted) && forms.info.whiteLabel.$invalid && forms.info.whiteLabel.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END WHITE LABEL -->\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}" data-ng-disabled="!license.custom"/>\n                                               </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n\n                                    <!-- GENERAL TAB -->\n                                  <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.signature" data-ng-submit="updateItemMailAccount()" novalidate>\n                                                     <!-- START SIGNATURE -->\n                                                      <div class="form-group">\n                                                              <div ckeditor="options" ng-model="account.signature"></div>\n                                                   </div>\n                                                        <!-- END WHITE LABEL -->\n\n                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/mail/account/view/setting/view/view.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                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n                                     </li>\n                                 <li data-ng-if="account.MailServerIn">\n                                                <a href="#" data-target="#tab_1_2" data-toggle="tab">IMAP</a>\n                                 </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_3" data-toggle="tab">SMTP</a>\n                                 </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <!-- BEGIN UI-GRID SPINNER -->\n                                <span us-spinner spinner-key="mail-spinner-grid" spinner-start-active="false"></span>\n                         <!-- END UI-GRID SPINNER -->\n\n                                <div class="tab-content">\n                                     <!-- GENERAL TAB -->\n                                  <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.info" data-ng-submit="forms.info.$valid && updateItemMailAccount()" novalidate>\n                                                     <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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="account.name" required/>\n                                                                <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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 ADDRESS -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.address" required/>\n                                                               <span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ADDRESS -->\n\n                                                        <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.ListId" name="list" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.ListId = null" class="btn btn-default">\n                                                                                          <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\n\n                                                   <!-- START TEMPLATE -->\n                                                       <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}</label>\n                                                                 <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.TemplateId" name="template" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_TEMPLATE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                   <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                            <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.TemplateId = null" class="btn btn-default">\n                                                                                              <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END TEMPLATE -->\n\n                                                       <!-- START FIDELITY -->\n                                                       <div class="form-group" data-ng-if="account.MailServerIn">\n                                                            <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="account.fidelity"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END FIDELITY -->\n\n                                                       <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n                                                                <span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$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.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n\n                                                    <!-- START SERVICE -->\n                                                        <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_SERVICE\' | translate}}</label><br>\n                                                              <input\n                                                                bs-switch\n                                                             data-ng-model="account.service"\n                                                               type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END SERVICE -->\n\n                                                        <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n\n                                    <!-- IMAP TAB -->\n                                     <div class="tab-pane" id="tab_1_2" data-ng-if="account.MailServerIn">\n                                         <div class="note note-danger" data-ng-show="account.MailServerIn.state === \'DISCONNECTED\' || account.MailServerIn.state === \'ERROR\'">\n                                                     <p> ERROR </p>\n                                                        <json-formatter open="1" json="account.MailServerIn.source"></json-formatter>\n                                         </div>\n\n                                              <div class="note note-success" data-ng-show="account.MailServerIn.state === \'CONNECTED\'">\n                                                   <p> CONNECTED </p>\n                                            </div>\n\n                                              <div class="note note-info" data-ng-show="account.MailServerIn.state === \'CONNECTING\'">\n                                                     <p> TRYING... </p>\n                                            </div>\n\n                                              <form name="forms.formIn" data-ng-submit="forms.formIn.$valid && updateItemMailServerIn()" novalidate>\n                                                        <!-- START HOST -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.host" required/>\n                                                           <span data-ng-show="(forms.formIn.host.$touched || forms.formIn.$submitted) && forms.formIn.host.$invalid && forms.formIn.host.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END HOST -->\n\n                                                   <!-- START USERNAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.username" required/>\n                                                               <span data-ng-show="(forms.formIn.username.$touched || forms.formIn.$submitted) && forms.formIn.username.$invalid && forms.formIn.username.$error.required"  class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.password" required/>\n                                                           <span data-ng-show="(forms.formIn.password.$touched || forms.formIn.$submitted) && forms.formIn.password.$invalid && forms.formIn.password.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n                                                       <!-- START PORT -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.port" required/>\n                                                         <span data-ng-show="(forms.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$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.formIn.port.$touched || forms.formIn.$submitted) && forms.formIn.port.$invalid && forms.formIn.port.$error.number" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END PORT -->\n\n                                                   <!-- START MAILBOX -->\n                                                        <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n                                                          <input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.mailbox"/>\n                                                   </div>\n                                                        <!-- END MAILBOX -->\n\n                                                        <!-- START SEARCH FILTER -->\n                                                  <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n                                                            <ui-select data-ng-model="account.MailServerIn.filter" name="filter" theme="bootstrap">\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                   <ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n                                                                          <div ng-bind-html="filter | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                        <!-- START SEARCH FILTER -->\n\n                                                        <!-- START connTimeout -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}} [sec]<span class="required" aria-required="true">*</span></label>\n                                                             <input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.connTimeout" required/>\n                                                             <span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$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.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END connTimeout -->\n\n                                                    <!-- START authTimeout -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}} [sec]<span class="required" aria-required="true">*</span></label>\n                                                           <input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="account.MailServerIn.authTimeout" required/>\n                                                           <span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$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.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END authTimeout -->\n\n                                                    <!-- START DELETE -->\n                                                 <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n                                                              <input\n                                                                bs-switch\n                                                             data-ng-model="account.MailServerIn.delete"\n                                                           type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END DELETE -->\n\n                                                 <!-- START SSL -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">SSL</label><br>\n                                                          <input\n                                                                bs-switch\n                                                             data-ng-model="account.MailServerIn.ssl"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END SSL -->\n\n                                                    <!-- START Keepalive -->\n                                                      <div class="form-group">\n                                                              <label class="control-label">Keepalive</label><br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="account.MailServerIn.keepalive"\n                                                                type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END Keepalive -->\n\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END IMAP TAB -->\n\n                                       <!-- SMTP TAB -->\n                                     <div class="tab-pane" id="tab_1_3">\n\n                                         <div class="note note-danger" data-ng-show="account.MailServerOut.state === \'DISCONNECTED\' || account.MailServerOut.state === \'ERROR\'">\n                                                   <p> ERROR </p>\n                                                        <json-formatter open="1" json="account.MailServerOut.source"></json-formatter>\n                                                </div>\n\n                                              <div class="note note-success" data-ng-show="account.MailServerOut.state === \'CONNECTED\'">\n                                                  <p> CONNECTED </p>\n                                            </div>\n\n                                              <div class="note note-info" data-ng-show="account.MailServerOut.state === \'CONNECTING\'">\n                                                    <p> TRYING... </p>\n                                            </div>\n\n                                              <form name="forms.formOut" data-ng-submit="forms.formOut.$valid && updateItemMailServerOut()" novalidate>\n\n                                                   <!-- START HOST -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_HOST\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.host" required/>\n                                                          <span data-ng-show="(forms.formOut.host.$touched || forms.formOut.$submitted) && forms.formOut.host.$invalid && forms.formOut.host.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END HOST -->\n\n                                                   <!-- START USERNAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.username" required/>\n                                                              <span data-ng-show="(forms.formOut.username.$touched || forms.formOut.$submitted) && forms.formOut.username.$invalid && forms.formOut.username.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.password" required/>\n                                                          <span data-ng-show="(forms.formOut.password.$touched || forms.formOut.$submitted) && forms.formOut.password.$invalid && forms.formOut.password.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n                                                       <!-- START PORT -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.formOut.port.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.MailServerOut.port" required/>\n                                                                <span data-ng-show="(forms.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$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.formOut.form.$touched || forms.formOut.$submitted) && forms.formOut.port.$invalid && forms.formOut.port.$error.number" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END PORT -->\n\n                                                   <!-- START SSL -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">SSL</label><br>\n                                                          <input\n                                                                bs-switch\n                                                             data-ng-model="account.MailServerOut.ssl"\n                                                             type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END SSL -->\n\n                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                                  <input class="btn blue-madison" type="button" value="Test" data-ng-click="test()"/>\n                                           </form>\n                                       </div>\n                                        <!-- END SMTP TAB -->\n                         </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
 a.put("app/channels/mail/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                                 <i class="fa fa-angle-right" data-ng-show="account"></i>\n                              </li>\n                         <li data-ng-show="account">\n                                   <a href="#">{{ account.description || account.name }}</a>\n                             </li>\n                 </ul>\n         </div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n               <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar" data-ng-init="initView()">\n                       <!-- PORTLET main.channels -->\n                        <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img ng-src="assets/images/media/account.png" class="img-responsive">\n                         </div>\n                                <!-- END SIDEBAR USERPIC -->\n\n                                <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{ account.description || account.name }}\n                                     </div>\n                                        <div class="profile-usertitle-job">\n                                           {{account.email}}\n                                     </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li ng-class="{active: $state.is(\'main.channels.mail.accounts.view.settings\')}">\n                                                    <a href="/channels/mail/accounts/view/{{account.id}}/settings">\n                                                       <i class="icon-settings"></i>\n                                                 {{\'APPLICATION_SETTINGS\' | translate}} </a>\n                                         </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.mail.accounts.view.hooks\')}" data-ng-if="account.MailServerIn">\n                                                     <a href="/channels/mail/accounts/view/{{account.id}}/hooks">\n                                                  <i class="fa fa-code"></i>\n                                                    {{\'APPLICATION_HOOKS\' | translate}} </a>\n                                            </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.mail.accounts.view.dispositions\')}" data-ng-if="account.MailServerIn">\n                                                      <a href="/channels/mail/accounts/view/{{account.id}}/dispositions">\n                                                   <i class="icon-target"></i>\n                                                   {{\'APPLICATION_DISPOSITIONS\' | translate}} </a>\n                                             </li>\n                                         <li ng-class="{active: $state.includes(\'main.channels.mail.accounts.view.actions\')}" data-ng-if="account.MailServerIn">\n                                                     <a href="/channels/mail/accounts/view/{{account.id}}/actions/list">\n                                                   <i class="icon-directions"></i>\n                                                       {{\'APPLICATION_ACTIONS\' | translate}} </a>\n                                          </li>\n                                         <li ng-class="{active: $state.includes(\'main.channels.mail.accounts.view.other\')}" data-ng-if="account.MailServerIn">\n                                                       <a href="/channels/mail/accounts/view/{{account.id}}/other">\n                                                  <i class="icon-equalizer"></i>\n                                                        {{\'APPLICATION_OTHER\' | translate}} </a>\n                                            </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <div ui-view class="profile-content"></div>\n           <!-- END PROFILE CONTENT -->\n  </div>\n<!-- END PAGE CONTENT-->\n</div>\n'),a.put("app/channels/mail/account/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n    <div class="col-md-12">\n               <!-- BEGIN PAGE HEADER-->\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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/mail/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                          </li>\n                 </ul>\n         </div>\n                <!-- END PAGE HEADER-->\n\n             <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n                                            <form name="forms.info" novalidate>\n                                                   <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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 ADDRESS -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_EMAIL_ADDRESS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="address" placeholder="{{\'APPLICATION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.address" required/>\n                                                          <span data-ng-show="(forms.info.address.$touched || forms.info.$submitted) && forms.info.address.$invalid && forms.info.address.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ADDRESS -->\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                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n                                               </form>\n                                       </wz-step>\n\n                                  <wz-step title="IMAP" canexit="formValidation(forms.in.$valid)">\n                                              <form name="forms.in" novalidate>\n                                                     <!-- START HOST -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_INCOMING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.host" required/>\n                                                              <span data-ng-show="(forms.in.host.$touched || forms.in.$submitted) && forms.in.host.$invalid && forms.in.host.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END HOST -->\n\n                                                   <!-- START USERNAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.username" name="username" required/>\n                                                          <span data-ng-show="(forms.in.username.$touched || forms.in.$submitted) && forms.in.username.$invalid && forms.in.username.$error.required"  class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.password" required/>\n                                                              <span data-ng-show="(forms.in.password.$touched || forms.in.$submitted) && forms.in.password.$invalid && forms.in.password.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n                                                       <!-- START PORT -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.port" required/>\n                                                            <span data-ng-show="(forms.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$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.in.port.$touched || forms.in.$submitted) && forms.in.port.$invalid && forms.in.port.$error.number" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END PORT -->\n\n                                                   <!-- START MAILBOX -->\n                                                        <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_MAILBOX\' | translate}}</label>\n                                                          <input type="text" name="mailbox" placeholder="{{\'APPLICATION_MAILBOX\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.mailbox"/>\n                                                      </div>\n                                                        <!-- END MAILBOX -->\n\n                                                        <!-- START SEARCH FILTER -->\n                                                  <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_SEARCH_FILTER\' | translate}}</label>\n                                                            <ui-select data-ng-model="item.MailServerIn.filter" name="filter" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                   <ui-select-choices repeat="filter in [\'UNSEEN\'] | filter: $select.search">\n                                                                          <div data-ng-bind="filter | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                        <!-- START SEARCH FILTER -->\n\n                                                        <!-- START connTimeout -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                           <input type="number" name="connTimeout" placeholder="{{\'APPLICATION_CONNECTION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.connTimeout" required/>\n                                                                <span data-ng-show="(forms.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$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.in.connTimeout.$touched || forms.in.$submitted) && forms.in.connTimeout.$invalid && forms.in.connTimeout.$error.number" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END connTimeout -->\n\n                                                    <!-- START authTimeout -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="number" name="authTimeout" placeholder="{{\'APPLICATION_AUTH_TIMEOUT\' | translate}}" class="form-control" data-ng-model="item.MailServerIn.authTimeout" required/>\n                                                              <span data-ng-show="(forms.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$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.in.authTimeout.$touched || forms.in.$submitted) && forms.in.authTimeout.$invalid && forms.in.authTimeout.$error.number" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END authTimeout -->\n\n                                                    <!-- START DELETE -->\n                                                 <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_DELETE_MAIL_FROM_SERVER\' | translate}}</label><br>\n                                                              <input\n                                                                bs-switch\n                                                             data-ng-model="item.MailServerIn.delete"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END DELETE -->\n\n                                                 <!-- START SSL -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">SSL</label><br>\n                                                          <input\n                                                                bs-switch\n                                                             data-ng-model="item.MailServerIn.ssl"\n                                                         type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END SSL -->\n\n                                                    <!-- START Keepalive -->\n                                                      <div class="form-group">\n                                                              <label class="control-label">Keepalive</label><br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="item.MailServerIn.keepalive"\n                                                           type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END Keepalive -->\n\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n                                            </form>\n                                       </wz-step>\n\n                                  <wz-step title="SMTP" canexit="formValidation(forms.out.$valid)">\n                                             <form name="forms.out" novalidate>\n                                                    <!-- START HOST -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_OUTGOING_MAIL_SERVER\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="host" placeholder="{{\'APPLICATION_HOST\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.host" required/>\n                                                             <span data-ng-show="(forms.out.host.$touched || forms.out.$submitted) && forms.out.host.$invalid && forms.out.host.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END HOST -->\n\n                                                   <!-- START USERNAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.username" required/>\n                                                         <span data-ng-show="(forms.out.username.$touched || forms.out.$submitted) && forms.out.username.$invalid && forms.out.username.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.password" required/>\n                                                             <span data-ng-show="(forms.out.password.$touched || forms.out.$submitted) && forms.out.password.$invalid && forms.out.password.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n                                                       <!-- START PORT -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.out.port.$touched || forms.out.$submitted) && forms.out.port.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_PORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="number" name="port" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="item.MailServerOut.port" required/>\n                                                           <span data-ng-show="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$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="(out.$touched || forms.out.$submitted) && forms.out.port.$invalid && forms.out.port.$error.number" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\n                                                       </div>\n                                                        <!-- END PORT -->\n\n                                                   <!-- START SSL -->\n                                                    <div class="form-group">\n                                                              <label class="control-label">SSL</label><br>\n                                                          <input\n                                                                bs-switch\n                                                             data-ng-model="item.MailServerOut.ssl"\n                                                                type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END SSL -->\n                                                      \n                                                      <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                                   <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" ng-click="goNext()"/>\n                                            </form>\n                                       </wz-step>\n\n                                  <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                 </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/mail/inbox/message/info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body"  data-ng-init="initInfo()">\n  <div class="form-group" ng-if="data">\n    <json-formatter json="data" open="1"></json-formatter>\n  </div>\n  <div class="note note-warning" data-ng-hide="data">\n    <h4 class="block"></h4>\n    <p>\n      {{ \'MESSAGE_NO_INFO_AVAILABLE\' | translate }}\n    </p>\n  </div>\n\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/channels/mail/inbox/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.from[0])">{{message.from[0]}} </a>\n      <br>\n      <span class="bold">To: </span>\n      <a href="" data-ng-click="openContact(to)" data-ng-repeat="to in message.to">{{to}}<span data-ng-if="!$last">, </span></a>\n      <br>\n      <span data-ng-if="message.cc.length" class="bold">Cc: </span>\n      <a href="" data-ng-click="openContact(cc)" data-ng-repeat="cc in message.cc">{{cc}}<span data-ng-if="!$last">, </span></a>\n      <br>\n      <span data-ng-if="message.bcc.length" class="bold">Bcc: </span>\n      <a href="" data-ng-click="openContact(bcc)" data-ng-repeat="cc in message.bcc">{{bcc}}<span data-ng-if="!$last">, </span></a>\n    </div>\n  <div class="row">\n    <div class="col-md-12">\n      <span class="pull-right" data-ng-if="message.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{message.User.fullname}}</strong></span>\n      <span class="pull-right" data-ng-if="message.voiceSource">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>Cally &#178;</strong>\n        <a ng-click="info(message.voiceSource)"><i class="icon-info font-blue"></i>\n        </a>\n      </span>\n    </div>\n  </div>\n  <br>\n  <span class="todo-tasklist-date">\n    <span class="pull-right" data-ng-switch="message.status" data-ng-if="message.status!==\'RECEIVED\'" uib-tooltip="{{\'APPLICATION_RETRY\' | translate}}: {{message.retry}}">\n      <a ng-switch-when="SENDING" href="#" class="btn default btn-xs inactive-link blue-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-warning"></i>\n      </a>\n      <a ng-switch-when="SENT" href="#" class="btn default btn-xs inactive-link green-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="FAILED" href="#" class="btn default btn-xs red-stripe" data-ng-click="retry(message.id)"> {{message.status | uppercase}}\n        <i class="fa fa-times"></i>\n      </a>\n    </span>\n    <span class="pull-right" data-ng-if="message.status===\'RECEIVED\'">\n      <a href="#" class="btn default btn-xs inactive-link green-stripe"> {{message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n    </span>\n    <i class="icon-calendar"></i> <span am-time-ago="message.updatedAt"></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  <hr data-ng-if="message.MailAttachments.length">\n  <div data-ng-repeat="mailAttachment in message.MailAttachments">\n    <strong>{{mailAttachment.name}}</strong>\n    <span>\n      ({{mailAttachment.size | prettyBytes}})\n    </span>\n    <a target="_self" download="{{mailAttachment.name}}" href="api/mail/attachments/{{mailAttachment.id}}">\n      <i class="icon-cloud-download"></i>\n    </a>\n    <a ng-if="::(mailAttachment.type.indexOf(\'image\') > -1)" ng-click="openPreview(mailAttachment.id)">\n      <i class="icon-picture"></i>\n    </a>\n  </div>\n</div>\n'),a.put("app/channels/mail/inbox/note/note.directive.html",'<div class="note">\n  <div class="row">\n    <div class="col-md-6">\n      <a type="button" name="button" data-ng-if="::(Auth.getCurrentUser().id == message.UserId)" data-ng-click="deleteNote()">\n        <i class="fa fa-trash-o" style="color: red;"></i>\n      </a>\n\n      <i class="icon-calendar"></i> <span am-time-ago="message.updatedAt"></span>\n    </div>\n    <div class="col-md-6">\n      <span class="pull-right" data-ng-show="message.User">{{\'APPLICATION_ADD_BY\' | translate}}: <strong>{{message.User.fullname}}</strong></span>\n    </div>\n  </div>\n  <hr>\n  <span class="body text-left" data-ng-bind-html="message.text" style="white-space: pre-wrap;"></span>\n</div>\n'),a.put("app/channels/mail/inbox/note/note.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_NOTES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <div class="form-group">\n      <textarea data-ng-model="item.text" name="text" rows="10" style="resize: none; width: 100%;"></textarea>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/room/room.directive.html",'<!-- BEGIN TODO CONTENT -->\n<div class="todo-content">\n       <div class="portlet light">\n           <div class="portlet-title">\n                   <div class="caption">\n                         <button data-ng-if="form.from.length && form.to.length && mailRoom.status !== \'CLOSED\' && form.html" class="btn btn-sm btn-default green-meadow" data-ng-click="sendMail()">\n                                        <i class="icon-paper-plane" style="color: white;"></i> {{\'APPLICATION_SEND\' | translate}}\n                           </button>\n                             <span data-ng-if="mailRoom && form.from.length && form.to.length && mailRoom.status !== \'CLOSED\' && form.html"> | </span>\n                           <span data-ng-if="mailRoom" class="label label-default"> #{{mailRoom.id}} {{mailRoom.status}}</span>\n                          <span data-ng-if="mailRoom"> | </span>\n                                <span data-ng-if="mailRoom && mailRoom.ParentId" class="label label-warning"> Ref: <a data-ng-click="openRoom(mailRoom.ParentId)">#{{mailRoom.ParentId}}</a></span>\n                           <span data-ng-if="mailRoom && mailRoom.ParentId"> | </span>\n                           <span data-ng-if="mailRoom" class="caption-subject font-green-sharp bold uppercase dot">{{mailRoom.subject || \'No subject\'}}</span>\n                 </div>\n                        <div class="actions">\n                         <button class="btn btn-icon-only yellow" data-ng-if="mailRoom" data-ng-click="loadNote()" data-ng-hide="mailRoom.status == \'CLOSED\'" title="{{\'APPLICATION_NOTES\' | translate}}">\n                                 <i class="fa fa-sticky-note"></i>\n                             </button>\n                             <button class="file-upload" data-ng-hide="mailRoom.status == \'CLOSED\'">\n                                     <i class="fa fa-paperclip"></i> <input type="file" data-ng-if="uploader" data-ng-disabled="mailRoom.status == \'CLOSED\'" nv-file-select uploader="uploader" multiple class="file-input" title="{{\'APPLICATION_ATTACHMENTS\' | translate}}">\n                         </button>\n                             <!-- UPDATE SECTION START -->\n                         <button data-ng-class="mailRoom.status == \'CLOSED\' ? \'grey-cascade\' : \'btn-success\'" class="btn btn-icon-only" data-ng-disabled="mailRoom.status == \'CLOSED\' && mailRoom.disposition" data-ng-if="mailRoom" data-ng-click="closeRoom()" title="{{\'APPLICATION_STATUS\' | translate}}">\n                                       <i data-ng-class="mailRoom.status == \'CLOSED\' ? \'icon-target\' : \'fa fa-upload\'"></i>\n                            </button>\n                             <!-- UPDATE SECTION END -->\n                           <button class="btn default btn-icon-only" data-ng-if="mailRoom && mailRoom.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-if="panelLeft" data-ng-class="panelLeft">\n                                        <div class="form">\n                                            <!-- START TAGS -->\n                                           <div class="form-group" data-ng-if="mailRoom.status !== \'CLOSED\'">\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($item, $model)" on-remove="onChanged($item, $model)" data-ng-disabled="mailRoom.status == \'CLOSED\'">\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\n                                      <hr data-ng-if="mailRoom && mailRoom.status !== \'CLOSED\'">\n\n                                        <!-- END TAGS -->\n                                     <div id="mail-box">\n                                           <ul class="chats">\n                                                    <li\n                                                   data-ng-switch="mailMessage.status"\n                                                   data-ng-class="{\'in\': mailMessage.status == \'RECEIVED\', \'out\': mailMessage.status == \'SENT\' || mailMessage.status == \'SENDING\' || mailMessage.status == \'FAILED\' || mailMessage.status == \'NOTE\'}"\n                                                      data-ng-repeat="mailMessage in mailRoom.MailMessages | orderBy:\'-createdAt\'">\n                                                       <div class="avatar" data-ng-class="message.UserId ? \'pretty-avatar\' : \'pretty-avatar-v\'">\n                                                         <ng-letter-avatar\n                                                             data-ng-if="mailMessage.UserId"\n                                                               height="40"\n                                                           width="40"\n                                                            fontsize="25"\n                                                         data="{{mailMessage.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="!mailMessage.UserId"\n                                                              height="40"\n                                                           width="40"\n                                                            fontsize="25"\n                                                         data="{{mailMessage.from[0]}}"\n                                                                avatarcustombgcolor="#B0B0B0"\n                                                         avatarcustomborder="border:2px solid #EA4C61"\n                                                         charCount="1"\n                                                         shape="round"></ng-letter-avatar>\n                                                     </div>\n                                                        <mail-note message="mailMessage" ng-switch-when="NOTE"></mail-note>\n                                                   <mail-message message="mailMessage" list-id="mailRoom.MailAccount.ListId" ng-switch-default></mail-message>\n                                           </li>\n                                 </ul>\n                         </div>\n                        </div>\n                        <div data-ng-class="panelRight">\n                              <div class="note note-info" data-ng-if="mailRoom && mailRoom.status == \'CLOSED\'">\n                                   <h4 class="block"><i class="icon-info"></i> {{\'MESSAGE_MAIL_ROOM_CLOSED\' | translate}}!</h4>\n                                        <p>\n                                           <strong>{{\'MESSAGE_MAIL_ROOM_CLOSED_DETAILS\' | translate}}.</strong>\n                                        </p>\n                                  <hr>\n                                  <p>\n                                           <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{mailRoom.disposition}}</strong>\n                                    </p>\n                                  <p>\n                                           <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{mailRoom.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="mailRoom.updatedAt"></span>)\n                                  </p>\n                          </div>\n                                <form name="forms.compose" data-ng-submit="sendMail()" class="form-horizontal" novalidate>\n                                    <!-- START HEAD -->\n                                   <div class="form">\n                                            <v-accordion class="vAccordion--default" ng-if="mailRoom.status !== \'CLOSED\'">\n                                                      <v-pane expanded="expanded">\n                                                          <v-pane-header>\n                                                                       <i class="icon-people"></i> From: {{form.from[0]}}, To: {{form.to[0].email}} <span ng-if="form.to.length > 1">(+{{form.to.length - 1}})</span>\n                                                                </v-pane-header>\n                                                              <v-pane-content>\n                                                                      <!-- START FROM -->\n                                                                   <div class="form-group" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                                          <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">From:</label>\n                                                                                            </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <ui-select data-ng-model="form.from[0]" data-ng-change="setList($select.selected.ListId)" theme="bootstrap" name="from" required>\n                                                                                                             <ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n                                                                                                            <ui-select-choices repeat="mailAccount.address as mailAccount in mailAccounts | filter: $select.search">\n                                                                                                                      <div data-ng-bind-html="mailAccount.name | highlight: $select.search"></div>\n                                                                                                                  <small data-ng-bind-html="mailAccount.address | highlight: $select.search"></small>\n                                                                                                           </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END FROM -->\n\n                                                                   <!-- MAIL TO -->\n                                                                      <div class="form-group" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                                          <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">To:</label>\n                                                                                              </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <tags-input ng-model="form.to" type="email" display-property="email">\n                                                                                                         <auto-complete source="getContacts($query)"></auto-complete>\n                                                                                                  </tags-input>\n                                                                                         </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END TO -->\n\n                                                                     <!-- START CC -->\n                                                                     <div class="form-group" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                                          <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">Cc:</label>\n                                                                                              </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <tags-input ng-model="form.cc" type="email" display-property="email">\n                                                                                                         <auto-complete source="getContacts($query)"></auto-complete>\n                                                                                                  </tags-input>\n                                                                                         </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END CC -->\n\n                                                                     <!-- START BCC -->\n                                                                    <div class="form-group" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                                          <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">Bcc:</label>\n                                                                                             </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <tags-input ng-model="form.bcc" type="email" display-property="email">\n                                                                                                                <auto-complete source="getContacts($query)"></auto-complete>\n                                                                                                  </tags-input>\n                                                                                         </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END BCC -->\n\n                                                                    <!-- START SUBJECT -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                                              <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">Subj:</label>\n                                                                                            </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <input type="text" name="subject" class="form-control todo-taskbody-taskdesc" placeholder="Subject..." rows="8" data-ng-model="form.subject">\n                                                                                                 <span data-ng-if="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                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END SUJBECT -->\n                                                          </v-pane-content>\n                                                     </v-pane>\n                                             </v-accordion>\n\n                                              <!-- START ATTACH -->\n                                         <div class="form-group" data-ng-if="uploader  && (mailRoom.status !== \'CLOSED\')">\n                                                   <div class="col-md-12">\n                                                               <hr ng-if="uploader.queue.length">\n                                                            <table class="table">\n                                                                 <tbody>\n                                                                               <tr ng-repeat="item in uploader.queue">\n                                                                                       <td style="border-top:none" rowspan="{{uploader.queue.length}}" ng-if="(!$index)">\n                                                                                            {{\'APPLICATION_ATTACHMENTS\' | translate}}:\n                                                                                  </td>\n                                                                                 <td style="border-top:none"><strong>{{ item.file.name }}</strong></td>\n                                                                                        <td style="border-top:none" ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>\n                                                                                 <td style="border-top:none" ng-show="uploader.isHTML5">\n                                                                                               <div class="progress" style="margin-bottom: 0;">\n                                                                                                      <div class="progress-bar" role="progressbar" ng-style="{ \'width\': item.progress + \'%\' }"></div>\n                                                                                           </div>\n                                                                                        </td>\n                                                                                 <td style="border-top-style:none" class="text-center">\n                                                                                                <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>\n                                                                                          <span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>\n                                                                                           <span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>\n                                                                                        </td>\n                                                                                 <td style="border-top-style:none" nowrap>\n                                                                                             <button type="button" class="btn btn-danger btn-xs" data-ng-click="item.remove()">\n                                                                                                    <span class="glyphicon glyphicon-trash"></span> {{\'APPLICATION_REMOVE\' | translate}}\n                                                                                                </button>\n                                                                                     </td>\n                                                                         </tr>\n                                                                 </tbody>\n                                                              </table>\n                                                              <div>\n                                                         </div>\n                                                        </div>\n                                                </div>\n                                                <!-- END ATTACH -->\n\n                                         <!-- START CANNED -->\n                                         <div class="form-group" data-ng-class="{\'has-error\': forms.compose.subject.$invalid && forms.compose.$submitted}" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                      <div class="col-md-12">\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="onSelectAnswer($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-if="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                                                        </div>\n                                                </div>\n                                                <!-- END CANNED -->\n\n                                         <!-- START HTML -->\n                                           <div class="form-group" data-ng-class="{\'has-error\': forms.compose.text.$invalid && forms.compose.$submitted}" data-ng-if="mailRoom.status !== \'CLOSED\'">\n                                                 <div class="col-md-12">\n                                                               <div ckeditor="options" ng-model="form.html" ready="onCKReady($instance)"></div>\n                                                              <span data-ng-if="forms.compose.text.$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                                                <!-- END HTML -->\n\n                                   </div>\n                                </form>\n                       </div>\n                </div>\n        </div>\n</div>\n</div>\n<!-- END TODO CONTENT -->\n"),
-a.put("app/channels/mail/inbox/status/status.modal.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 data-ng-if="modal.title" data-ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-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="disposition" 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-if="dispositions.length < 1">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate }}\n      </p>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\n                  <a href="#" class="btn btn-icon-only btn-success" data-ng-click="disposeItems();" data-ng-show="id.length">\n                           <i class="fa fa-upload"></i>\n                  </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></span>\n              <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" class="ui-grid" ui-grid-auto-resize ui-grid-pagination ui-grid-selection>\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'),a.put("app/channels/mail/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-note"></i>\n                                     <a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n        </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox">\n <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == mailAccount.id}" data-ng-repeat="mailAccount in mailAccounts">\n                         <a href="/channels/mail/inbox/view/account/{{mailAccount.id}}/list" class="btn">\n                                      <i class="icon-notebook"></i> {{mailAccount.name}}\n                            </a>\n                          <b></b>\n                       </li>\n         </ul>\n </div>\n\n      <div class="col-md-9" data-ng-init="initView()">\n              <!-- BEGIN PROFILE CONTENT -->\n                <div class="room-content">\n                    <div ui-view>\n                         <div class="note note-info">\n                                  <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                              </div>\n                        </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n\n</div>\n'),a.put("app/channels/mail/inbox/view/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'),a.put("app/channels/mail/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.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/mail/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 strategies | 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" min="0" 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/mail/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-envelope"></i>\n                                         <a href="#">{{ \'APPLICATION_MAIL\' | 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                                        <div class="btn-group" data-ng-if="Auth.isAdmin()">\n                                           <a class="btn green-jungle" href="#" data-ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | 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/mail/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/mail/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-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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/mail/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.channels -->\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 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.channels.mail.queues.view.settings\')}">\n                                         <a data-ng-href="/channels/mail/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.mail.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                   <a data-ng-href="/channels/mail/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.channels -->\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/mail/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 && updateMailQueue()" 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 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                                    <!-- START TIMEOUT -->\n                                        <div class="form-group">\n                                              <label class="control-label">Agent Timeout</label>\n                                            <input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n                                        </div>\n                                        <!-- END TIMEOUT -->\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 strategies | 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                                       <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/mail/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/mail/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/mail/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/mail/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/mail/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | 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.mail.realtime.view.agents\')}">\n                                                     <a href="/channels/mail/realtime/view/agents">\n                                                                {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.mail.realtime.view.applications\')}">\n                                                       <a href="/channels/mail/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/mail/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n       <div class="col-md-12">\n               <!-- START TABLE -->\n          <div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="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 PAGE CONTENT-->\n'),a.put("app/channels/openchannel/account/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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/openchannel/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" href="/channels/openchannel/accounts/wizard">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | 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/openchannel/account/view/action/list/list.html",'<div class="row" data-ng-init="initActions()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/openchannel/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n                                                  <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),
+a.put("app/channels/mail/inbox/status/status.modal.html",'<div class="modal-header">\n  <button data-ng-if="modal.dismissable" type="button" data-ng-click="$dismiss()" class="close">&times;</button>\n  <h4 data-ng-if="modal.title" data-ng-bind="modal.title | translate" class="modal-title"></h4>\n</div>\n<div class="modal-body">\n  <p data-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="disposition" 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-if="dispositions.length < 1">\n      <h4 class="block">Warning!</h4>\n      <p>\n        {{ \'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate }}\n      </p>\n    </div>\n  </form>\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\n                  <a href="#" class="btn btn-icon-only btn-success" data-ng-click="disposeItems();" data-ng-show="id.length">\n                           <i class="fa fa-upload"></i>\n                  </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></span>\n              <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" class="ui-grid" ui-grid-auto-resize ui-grid-pagination ui-grid-selection>\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'),a.put("app/channels/mail/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/mail/inbox/view/view.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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-note"></i>\n                                     <a href="#">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n        </div>\n</div>\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox">\n <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == mailAccount.id}" data-ng-repeat="mailAccount in mailAccounts">\n                         <a href="/channels/mail/inbox/view/account/{{mailAccount.id}}/list" class="btn">\n                                      <i class="icon-notebook"></i> {{mailAccount.name}}\n                            </a>\n                          <b></b>\n                       </li>\n         </ul>\n </div>\n\n      <div class="col-md-9" data-ng-init="initView()">\n              <!-- BEGIN PROFILE CONTENT -->\n                <div class="room-content">\n                    <div ui-view>\n                         <div class="note note-info">\n                                  <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                              </div>\n                        </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n\n</div>\n'),a.put("app/channels/mail/inbox/view/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'),a.put("app/channels/mail/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.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/mail/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 strategies | 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" min="0" 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/mail/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-envelope"></i>\n                                         <a href="#">{{ \'APPLICATION_MAIL\' | 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                                        <div class="btn-group" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                               <a class="btn green-jungle" href="#" data-ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | 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/mail/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/mail/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-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-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/mail/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.channels -->\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 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.channels.mail.queues.view.settings\')}">\n                                         <a data-ng-href="/channels/mail/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.mail.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                   <a data-ng-href="/channels/mail/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.channels -->\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/mail/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 && updateMailQueue()" 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 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                                    <!-- START TIMEOUT -->\n                                        <div class="form-group">\n                                              <label class="control-label">Agent Timeout</label>\n                                            <input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n                                        </div>\n                                        <!-- END TIMEOUT -->\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 strategies | 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                                       <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/mail/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/mail/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/mail/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/mail/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/mail/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-envelope"></i>\n                                 <a href="#">{{ \'APPLICATION_MAIL\' | 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.mail.realtime.view.agents\')}">\n                                                     <a href="/channels/mail/realtime/view/agents">\n                                                                {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.mail.realtime.view.applications\')}">\n                                                       <a href="/channels/mail/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/mail/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n       <div class="col-md-12">\n               <!-- START TABLE -->\n          <div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="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 PAGE CONTENT-->\n'),a.put("app/channels/openchannel/account/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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/openchannel/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" href="/channels/openchannel/accounts/wizard">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | 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/openchannel/account/view/action/list/list.html",'<div class="row" data-ng-init="initActions()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/openchannel/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n                                                  <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),
 a.put("app/channels/openchannel/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.settings" ng-submit="updateItem()" novalidate>\n                                      <!-- START APP -->\n                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                       </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END APP -->\n\n                                    <!-- START HOST -->\n                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                           <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                             <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                         <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 HOST -->\n\n                                   <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                          <!-- START QUEUE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.OpenchannelQueueId" name="queue" theme="bootstrap" required>\n                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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                                                  <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END QUEUE -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                          <!-- START AGENT -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END AGENT -->\n                                    </div>\n\n                                      <!-- START INTERVAL_TYPE -->\n                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n                                           <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                               {{ intType.name | translate }}\n                                                        </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END INTERVAL_TYPE -->\n\n                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                <!-- START TIME -->\n                                           <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                   <div class="input-group input-large">\n                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                             </fieldset>\n                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                     </div>\n                                                </div>\n                                                <!-- END TIME -->\n\n                                           <!-- START ALWAYS -->\n                                         <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                 <div class="input-group input-large">\n                                                         <label class="control-label pointer-cursor">\n                                                                  <input\n                                                                                bs-switch\n                                                                             data-ng-model="application.alwaysTime"\n                                                                                type="checkbox"\n                                                                               switch-active="{{ isActive }}"\n                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                switch-on-color="{{ onColor }}"\n                                                                               switch-off-color="{{ offColor }}"\n                                                                             switch-animate="{{ animate }}"\n                                                                                switch-size="{{ size }}"\n                                                                              switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                              switch-radio-off="{{ radioOff }}"\n                                                                             switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                               </label>\n                                                      </div>\n                                                </div>\n                                                <!-- END ALWAYS -->\n\n                                         <!-- START WEEKDAY -->\n                                                <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                        <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END WEEKDAY -->\n\n                                                <!-- START MONTHDAY -->\n                                               <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                       <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTHDAY -->\n\n                                               <!-- START MONTH -->\n                                          <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                  <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTH -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                          <!-- START INTERVALS -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                    {{ interval.name}}\n                                                            </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                                                               <h4 class="block">Warning!</h4>\n                                                               <p>\n                                                                   {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                                                           </p>\n                                                          <p>\n                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                                                           </p>\n                                                  </div>\n                                                        <span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVALS -->\n\n                                      </div>\n                                        <button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n                          </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/openchannel/account/view/action/wizard/wizard.html",'<div class="row" data-ng-init="initWizard()">\n   <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n                                           <form name="forms.action" novalidate>\n                                                 <!-- START APP -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n                                                                <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APP -->\n\n                                                    <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                                          <!-- START AGENT -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                                                                          <h4 class="block">Warning!</h4>\n                                                                               <p>\n                                                                                   {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                                                                             </p>\n                                                                          <p>\n                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                                                                         </p>\n                                                                  </div>\n                                                                        <span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END AGENT -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                        </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                                          <!-- START QUEUE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.ChatQueueId" name="queue" theme="bootstrap" required>\n                                                                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                                                                          <h4 class="block">Warning!</h4>\n                                                                               <p>\n                                                                                   {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                                                                             </p>\n                                                                          <p>\n                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/openchannel/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                                                                          </p>\n                                                                  </div>\n                                                                        <span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                  </div>\n\n                                                      <!-- START INTERVAL_TYPE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n                                                         <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                               {{ intType.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVAL_TYPE -->\n\n                                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                             </fieldset>\n                                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="application.alwaysTime">\n                                                                                       <uib-timepicker name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                         </fieldset>\n                                                                           <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                     </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                                bs-switch\n                                                                                             data-ng-model="application.alwaysTime"\n                                                                                                type="checkbox"\n                                                                                               switch-active="{{ isActive }}"\n                                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                switch-on-color="{{ onColor }}"\n                                                                                               switch-off-color="{{ offColor }}"\n                                                                                             switch-animate="{{ animate }}"\n                                                                                                switch-size="{{ size }}"\n                                                                                              switch-label="{{ label }}"\n                                                                                            switch-icon="{{ icon }}"\n                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                                               </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate}}\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate }}\n                                                                                        </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                                          <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                                    {{ interval.name}}\n                                                                            </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                                                                               <h4 class="block">Warning!</h4>\n                                                                               <p>\n                                                                                   {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                                                                           </p>\n                                                                          <p>\n                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                                                                           </p>\n                                                                  </div>\n                                                                        <span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n\n                                                      <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}" />\n                                                </form>\n                                       </wz-step>\n                                    <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}" />\n                                 </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/openchannel/account/view/api/view/view.html",'<div class="row" data-ng-init="initView()">\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_API\' | translate}}</span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <div class="tab-pane active" id="tab_1_1">\n                                                    <!-- START API -->\n                                                    <div  class="row" >\n                                                                   <div class="col-md-12">\n                                                                               <label class="control-label">Receive URL</label>\n                                                                      </div>\n                                                                </div>\n                                                        <div   class="row" >\n                                                                  <div class="col-md-11">\n                                                                               <code-mirror  model="receiveurl"></code-mirror>\n                                                                       </div>\n                                                                        <div class="col-md-1">\n                                                                                <a class="btn btn-sm green-jungle" data-ng-click="copyToClipboard(receiveurl);"><i class="fa fa-clipboard"></i>\n                                                                               </a>\n                                                                  </div>\n                                                        </div>\n                                                        <!-- END API -->\n                                      </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/openchannel/account/view/disposition/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$error.required" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n        </span>\n      </div>\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/openchannel/account/view/disposition/view/view.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_DISPOSITIONS\' | translate}}</span>\n                            </div>\n                                <div class="actions actions-md">\n                                      <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
 a.put("app/channels/openchannel/account/view/hooks/view/view.html",'<div class="row" data-ng-init="initView()">\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_HOOKS\' | 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_SEND\' | translate}}</a>\n                                 </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_ACCEPT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_REJECT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_4" data-toggle="tab">{{\'APPLICATION_CLOSE\' | translate}}</a>\n                                        </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- START REPLY TAB -->\n                                      <div class="tab-pane  active" id="tab_1_1">\n                                           <form name="forms.info" data-ng-submit="forms.info.$valid && updateItem()" novalidate>\n                                                        <div  class="row">\n                                                            <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.info.method.$touched || forms.info.$submitted) && forms.info.method.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.replyMethod" name="method" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search" >\n                                                                                    <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.info.method.$touched || forms.info.$submitted) && forms.info.method.$invalid && forms.info.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.info.url.$touched || forms.info.$submitted) && forms.info.url.$invalid}">\n                                                                      <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.replyUrl"   ng-required="account.replyMethod"/>\n                                                                    <span data-ng-show="(forms.info.url.$touched || forms.info.$submitted) && forms.info.url.$invalid && forms.info.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END REPLY TAB -->\n\n                                      <!-- START ACCEPT TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.accept" data-ng-submit="forms.accept.$valid && updateItem()" novalidate>\n                                                            <div class="row">\n                                                                     <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid}">\n                                                                          <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                           <ui-select data-ng-model="account.acceptMethod" name="method" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                                 <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                             <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid && forms.accept.method.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <div  class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                              <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.acceptUrl"  ng-required="account.acceptMethod"/>\n                                                                           <span data-ng-show="(forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid && forms.accept.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                </div>\n                                                                <!-- START ACTIONS-->\n                                                         <div class="row" ng-repeat = "action in account.actions">\n                                                                     <div  ng-switch="action.action">\n                                                                                      <div ng-switch-when="pause">\n                                                                                          <div  class="form-group col-md-4">\n                                                                                                    <label class="control-label">{{\'APPLICATION_PAUSE\' | translate}}</label></br>\n                                                                                                               <input\n                                                                                                                bs-switch\n                                                                                                             data-ng-change="resetActionData(action)"\n                                                                                                              data-ng-model="action.enabled"\n                                                                                                                type="checkbox"\n                                                                                                               switch-active="{{ isActive }}"\n                                                                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                                          switch-on-color="{{ onColor }}"\n                                                                                                               switch-off-color="{{ offColor }}"\n                                                                                                             switch-animate="{{ animate }}"\n                                                                                                                switch-size="{{ size }}"\n                                                                                                              switch-label="{{ label }}"\n                                                                                                            switch-icon="{{ icon }}"\n                                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                                      </div>\n                                                                                                        <div ng-if="action.enabled" class="form-group col-md-8">\n                                                                                                              <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                                                             <ui-select  name="action" data-ng-model="action.type"  theme="bootstrap" >\n                                                                                                                    <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                                                       <ui-select-choices repeat=" pause.name as pause in pauses | filter: $select.search">\n                                                                                                                          <div ng-bind-html="pause.name | highlight: $select.search | uppercase" ></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                  </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                <!-- END ACTION -->\n                                                           <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START REJECT TAB -->\n                                     <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.reject" data-ng-submit="forms.reject.$valid && updateItem()" novalidate>\n                                                    <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.rejectMethod" name="method" theme="bootstrap" >\n                                                                             <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid && forms.reject.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.rejectUrl" ng-required="account.rejectMethod"/>\n                                                                    <span data-ng-show="(forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid && forms.reject.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END REJECT TAB -->\n                                       <!-- START CLOSE TAB -->\n                                      <div class="tab-pane" id="tab_1_4">\n                                           <form name="forms.close" data-ng-submit="forms.close.$valid && updateItem()" novalidate>\n                                                      <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.closeMethod" name="method" theme="bootstrap" >\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid && forms.close.method.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.closeUrl" ng-required="account.closeMethod"/>\n                                                                      <span data-ng-show="(forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid && forms.close.url.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END CLOSE TAB -->\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/openchannel/account/view/setting/view/view.html",'<div class="row" data-ng-init="initView()">\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                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\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.info" data-ng-submit="forms.info.$valid && updateItem()" novalidate>\n                                                        <!-- START ID -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ID\' | translate}}<span class="required" aria-required="true">*</span>\n                                                           </label>\n                                                              <input type="text" name="id" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.id" ng-disabled="true" required/>\n                                                 </div>\n                                                        <!-- END ID-->\n                                                        <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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="account.name" required/>\n                                                                <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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                                                     <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.ListId" name="list" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.ListId = null" class="btn btn-default">\n                                                                                          <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\n                                                     <!-- START FIDELITY -->\n                                                       <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="account.fidelity"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END FIDELITY -->\n\n                                                       <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n                                                                <span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$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.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n\n                                                    <!-- START CUSTOM -->\n                                                 <!-- <div  class="form-group">\n                                                                <label class="control-label">{{\'APPLICATION_REPLY\' | translate}}</label></br>\n                                                               <input\n                                                                bs-switch\n                                                             data-ng-model="account.reply"\n                                                         type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div> -->\n                                                    <!-- START REPLY HOOK -->\n                                                     <!-- <div  ng-if= "account.reply" class="row">\n                                                                <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.info.method.$touched || forms.info.$submitted) && forms.info.method.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.replyMethod" name="method" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search" >\n                                                                                    <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.info.method.$touched || forms.info.$submitted) && forms.info.method.$invalid && forms.info.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.info.url.$touched || forms.info.$submitted) && forms.info.url.$invalid}">\n                                                                      <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.replyUrl"  required/>\n                                                                      <span data-ng-show="(forms.info.url.$touched || forms.info.$submitted) && forms.info.url.$invalid && forms.info.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div> -->\n                                                    <!-- START REPLY HOOK -->\n                                                     <!-- END CUSTOM -->\n\n                                                 <!-- START REMOTE IP -->\n                                                      <div  class="form-group" data-ng-class="{\'has-error\': (forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remote" required/>\n                                                           <span class="help-block help-block-info">\n                                                                     {{\'MESSAGE_MOTION_ADDRESS_FORMAT\' | translate}}\n                                                             </span>\n                                                               <span data-ng-show="(forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid && forms.info.remote.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END REMOTE IP -->\n                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/openchannel/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/openchannel/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                                  <i class="fa fa-angle-right" data-ng-show="account"></i>\n                              </li>\n                         <li data-ng-show="account">\n                                   <a href="#">{{ account.description || account.name }}</a>\n                             </li>\n                 </ul>\n         </div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n               <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET main.channels -->\n                        <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img ng-src="assets/images/media/account.png" class="img-responsive">\n                         </div>\n                                <!-- END SIDEBAR USERPIC -->\n\n                                <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{ account.description || account.name }}\n                                     </div>\n                                        <div class="profile-usertitle-job">\n                                           {{account.email}}\n                                     </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li ng-class="{active: $state.is(\'main.channels.openchannel.accounts.view.settings\')}">\n                                                     <a href="/channels/openchannel/accounts/view/{{account.id}}/settings">\n                                                        <i class="icon-settings"></i>\n                                                 {{\'APPLICATION_SETTINGS\' | translate}} </a>\n                                         </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.openchannel.accounts.view.api\')}">\n                                                  <a href="/channels/openchannel/accounts/view/{{account.id}}/api">\n                                                     <i class="fa fa-external-link"></i>\n                                                   {{\'APPLICATION_API\' | translate}} </a>\n                                              </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.openchannel.accounts.view.hooks\')}">\n                                                        <a href="/channels/openchannel/accounts/view/{{account.id}}/hooks">\n                                                   <i class="fa fa-code"></i>\n                                                    {{\'APPLICATION_HOOKS\' | translate}} </a>\n                                            </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.openchannel.accounts.view.dispositions\')}">\n                                                 <a href="/channels/openchannel/accounts/view/{{account.id}}/dispositions">\n                                                    <i class="icon-target"></i>\n                                                   {{\'APPLICATION_DISPOSITIONS\' | translate}} </a>\n                                             </li>\n                                         <li ng-class="{active: $state.includes(\'main.channels.openchannel.accounts.view.actions\')}">\n                                                        <a href="/channels/openchannel/accounts/view/{{account.id}}/actions/list">\n                                                    <i class="icon-directions"></i>\n                                                       {{\'APPLICATION_ACTIONS\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <div ui-view class="profile-content"></div>\n           <!-- END PROFILE CONTENT -->\n  </div>\n<!-- END PAGE CONTENT-->\n</div>\n'),a.put("app/channels/openchannel/account/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n     <div class="col-md-12">\n               <!-- BEGIN PAGE HEADER-->\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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/openchannel/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                          </li>\n                 </ul>\n         </div>\n                <!-- END PAGE HEADER-->\n\n             <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n             <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n                                                    <form name="forms.info" novalidate>\n                                                           <!-- START NAME -->\n                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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                                                                      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n                                                               </div>\n                                                                <!-- END DESCRIPTION -->\n                                                              <!-- START REMOTE IP -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                      <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remote" required/>\n                                                                      <span class="help-block help-block-info">\n                                                                             {{\'MESSAGE_MOTION_ADDRESS_FORMAT\' | translate}}\n                                                                     </span>\n                                                                       <span data-ng-show="(forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid && forms.info.remote.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END REMOTE IP -->\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n                                                       </form>\n                                               </wz-step>\n                                            <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                                   <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/openchannel/inbox/message/info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body"  data-ng-init="initInfo()" style=" overflow-x: auto;" >\n  <div  data-ng-if="data" >\n    <json-formatter json="data" open="1"></json-formatter>\n  </div>\n  <div class="note note-warning" data-ng-hide="data">\n    <p>\n      {{ \'MESSAGE_NO_INFO_AVAILABLE\' | translate }}\n    </p>\n  </div>\n\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/channels/openchannel/inbox/message/message.html",'<div class="message">\n  <div class="row">\n    <div class="col-md-6">\n        <!-- <span data-ng-if="Message.from" class="bold">From: {{Message.from}} </span>\n        <br>\n        <span data-ng-if="Message.to" class="bold">To: {{Message.to}} </span>\n        <br> -->\n        <div class="row" ng-if="Message.from">\n          <div class="col-md-12">\n            <span data-ng-if="Message.from" class="bold">From: {{Message.from}} </span>\n          </div>\n        </div>\n        <div class="row" ng-if="Message.to">\n          <div class="col-md-12">\n            <span data-ng-if="Message.to" class="bold">To: {{Message.to}} </span>\n          </div>\n        </div>\n        <div class="row" ng-if="Message.name">\n          <div class="col-md-12">\n            <span   class="bold">Name: {{Message.name}}</span>\n          </div>\n        </div>\n        <div class="row" ng-if="Message.phone">\n          <div class="col-md-12">\n            <span  class="bold">Phone: <a href="" data-ng-click="openContact(\'phone\',Message.phone)">{{Message.phone}}</a></span>\n          </div>\n        </div>\n        <div class="row" ng-if="Message.email">\n          <div class="col-md-12">\n            <span  class="bold">Email: <a href="" data-ng-click="openContact(\'email\',Message.email)">{{Message.email}}</a></span>\n          </div>\n        </div>\n    </div>\n    <div class="col-md-6">\n      <span class="pull-right" data-ng-if="Message.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{Message.User.fullname}}</strong></span>\n    </div>\n  </div>\n  <br>\n  <span class="todo-tasklist-date">\n    <span class="pull-right" data-ng-switch="Message.status">\n      <a ng-switch-when="RECEIVED" href="#" class="btn default btn-xs inactive-link green-stripe"> {{Message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="SENT" href="#" class="btn default btn-xs inactive-link green-stripe"> {{Message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="DELIVERED" href="#" class="btn default btn-xs inactive-link green-stripe"> {{Message.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="SENDING" href="#" class="btn default btn-xs inactive-link blue-stripe" > {{Message.status | uppercase}}\n        <i class="fa fa-warning"></i>\n      </a>\n      <a ng-switch-when="FAILED" href="#" class="btn default btn-xs red-stripe" data-ng-click="info(Message.res_data)"> {{Message.status | uppercase}}\n        <i class="fa fa-times"></i>\n      </a>\n      <a ng-switch-default href="#" class="btn default btn-xs"> {{Message.status | uppercase}}\n      </a>\n      <br>\n    </span>\n\n    <i class="icon-calendar"></i> <span am-time-ago="Message.updatedAt"></span>\n  </span>\n  <hr>\n  <ng-emoticons emoticons-data="Message.body"></ng-emoticons>\n  <!-- <span class="body text-left" data-ng-bind-html="Message.body" style="white-space: pre-wrap;"></span> -->\n  </div>\n'),
-a.put("app/channels/openchannel/inbox/room/room.directive.html",'<!-- BEGIN TODO CONTENT -->\n\n<div class="todo-content">\n   <div class="portlet light">\n           <div class="portlet-title">\n                   <div class="caption">\n                         <button class="btn btn-sm btn-default green-meadow" data-ng-if="Room.status !== \'CLOSED\'" data-ng-disabled="!form.body || forms.compose.from.$invalid || forms.compose.to.$invalid" data-ng-click="sendMessage()">\n                                  <i class="icon-paper-plane" style="color: white;"></i> {{\'APPLICATION_SEND\' | translate}}\n                           </button>\n                             <span data-ng-show="Room && Room.status !== \'CLOSED\'"> | </span>\n                            <span data-ng-show="Room" class="label label-default">#{{Room.id}} {{Room.status}}</span>\n                             <span data-ng-if="Room && Room.ParentId"> | </span>\n                           <span data-ng-if="Room && Room.ParentId" class="label label-warning"> Ref: <a data-ng-click="openRoom(Room.ParentId,Room.contact)">#{{Room.ParentId}}</a></span>\n                      </div>\n                        <div class="actions" data-ng-switch="Room.status">\n                            <button class="btn btn-icon-only" data-ng-show="Room"  data-ng-class="{\'btn-success\':Room.status !== \'CLOSED\',\'grey-cascade\':Room.status === \'CLOSED\'}" data-ng-click="closeRoom(Room.id)"  data-ng-disabled="Room.status === \'CLOSED\' && Room.disposition">\n                                        <i data-ng-class="{\'fa fa-upload\':Room.status !== \'CLOSED\',\'icon-target\':Room.status === \'CLOSED\'}"></i>\n                              </button>\n                             <button  class="btn default btn-icon-only" data-ng-if="Room && Room.status !== \'CLOSED\'" type="button" 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-show="panelLeft" data-ng-class="panelLeft">\n                                      <div class="form">\n                                            <!-- START TAGS -->\n                                           <div class="form-group" data-ng-if="Room.status !== \'CLOSED\' || (Room.status == \'CLOSED\' && form.tags.length)">\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 data-ng-disabled="Room.status == \'CLOSED\'"  multiple data-ng-model="form.tags" theme="bootstrap" on-select="onChanged($item, $model)" on-remove="onChanged($item, $model)">\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                                        <hr data-ng-if="Room && Room.status !== \'CLOSED\'">\n\n                                        <div ng-scrollbars ng-scrollbars-config="{\n                                            autoHideScrollbar: false,\n                                             theme: \'light\',\n                                             advanced: {\n                                                   updateOnContentResize: true\n                                           },\n                                            setHeight: 781,\n                                               scrollInertia: 0\n                                      }">\n                                           <ul class="chats">\n                                                    <li data-ng-switch="Room.status" data-ng-class="{\'in\': Message.status == \'RECEIVED\', \'out\': Message.status == \'SENT\' || Message.status == \'SENDING\' || Message.status == \'FAILED\' || Message.status == \'NOTE\'  || Message.status == \'DELIVERED\' || Message.status == \'QUEUED\' ||  Message.status != \'RECEIVED\' }" data-ng-repeat="Message in Room.OpenchannelMessages | orderBy:\'-createdAt\'">\n                                                          <!-- <img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && smsMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}"> -->\n                                                            <!-- <note message="smsMessage" ng-switch-when="NOTE"></note> -->\n                                                             <div class="avatar" data-ng-class="Message.UserId ? \'pretty-avatar\' : \'pretty-avatar-v\'">\n                                                                 <ng-letter-avatar\n                                                                     data-ng-if="Message.UserId"\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.UserId"\n                                                                  height="40"\n                                                                   width="40"\n                                                                    fontsize="25"\n                                                                 data="{{Message.from}}"\n                                                                       avatarcustombgcolor="#B0B0B0"\n                                                                 avatarcustomborder="border:2px solid #EA4C61"\n                                                                 charCount="1"\n                                                                 shape="round"></ng-letter-avatar>\n                                                             </div>\n                                                                <message message="Message" list-id="Room.OpenchannelAccount.ListId"  ng-switch-default></message>\n                                                     </li>\n                                         </ul>\n                                 </div>\n                                </div>\n                                <div data-ng-class="panelRight">\n\n                                    <div class="note note-info" data-ng-if="Room && Room.status == \'CLOSED\'">\n                                           <h4 class="block">Info! {{\'MESSAGE_ROOM_CLOSED\' | translate}}</h4>\n                                          <p>\n                                                   {{\'MESSAGE_ROOM_CLOSED_DETAILS\' | translate}}.\n                                              </p>\n                                          <hr>\n                                          <p>\n                                                   <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{Room.disposition}}</strong>\n                                                </p>\n                                          <p>\n                                                   <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{Room.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="Room.updatedAt"></span>)\n                                          </p>\n                                  </div>\n                                        <form  name="forms.compose" data-ng-submit="forms.compose.$valid" class="form-horizontal" novalidate>\n                                         <!-- START HEAD -->\n                                           <div class="form">\n\n                                                  <!-- START FROM -->\n                                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}" data-ng-if="Room.status !== \'CLOSED\'">\n                                                                             <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">From:</label>\n                                                                                            </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <ui-select  data-ng-disabled="Room"  theme="bootstrap" name="from" data-ng-model="form.from" required>\n                                                                                                                <ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n                                                                                                            <ui-select-choices repeat="Account.name as Account in Accounts | filter: $select.search">\n                                                                                                                     <div data-ng-bind-html="Account.name | highlight: $select.search"></div>\n                                                                                                                      <small data-ng-bind-html="Account.name | highlight: $select.search"></small>\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span data-ng-show="forms.compose.from.$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                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END FROM -->\n                                                     <!-- START TO -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}" data-ng-if="Room.status !== \'CLOSED\'">\n\n                                                             <div class="col-md-12">\n                                                                       <div class="row">\n                                                                             <div class="col-md-1">\n                                                                                        <label class="control-label">To:</label>\n                                                                              </div>\n                                                                                <div class="col-md-11">\n                                                                                       <input type="text"   name="to" class="form-control todo-taskbody-taskdesc" placeholder="To..." rows="8"   data-ng-disabled="Room" data-ng-model="form.to" required>\n                                                                                   <span data-ng-show="forms.compose.to.$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                                                                </div>\n                                                        </div>\n                                                        <!-- END TO -->\n                                                       <!-- START CANNED -->\n                                                 <div class="form-group"  data-ng-if="Room.status !== \'CLOSED\'">\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                                                                        </div>\n                                                                </div>\n\n                                                      </div>\n                                                        <!-- END CANNED -->\n                                                   <!-- START message -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.compose.body.$invalid && forms.compose.$submitted}" data-ng-if=" Room.status !== \'CLOSED\'">\n                                                            <div class="col-md-12">\n                                                                       <textarea id="text" class="form-control maxlength-handler" rows="8"  name="body" data-ng-model="form.body"></textarea>\n                                                                        <span data-ng-show="forms.compose.body.$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                                                      <!-- END message -->\n                                          </div>\n                                        </form>\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n<!-- END TODO CONTENT -->\n"),a.put("app/channels/openchannel/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></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 ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid-inbox">\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'),a.put("app/channels/openchannel/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/openchannel/inbox/view/view.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-globe"></i>\n          <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n                                   <i class="icon-note"></i>\n                                     <a href="/channels/openchannel/inbox/list">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                                </li>\n      </ul>\n    </div>\n  </div>\n</div>\n\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox" data-ng-init="initView()">\n   <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == Account.id}" data-ng-repeat="Account in Accounts">\n                             <a href="/channels/openchannel/inbox/view/account/{{Account.id}}/list" class="btn">\n                                   <i class="icon-notebook"></i> {{Account.name}}\n                                </a>\n        <b></b>\n                 </li>\n         </ul>\n </div>\n\n      <div class="col-md-9" >\n               <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view>\n                 <div class="note note-info">\n                          <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                      </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/openchannel/inbox/view/view.status.modal.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>\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</div>\n'),a.put("app/channels/openchannel/inbox/view/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'),a.put("app/channels/openchannel/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 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" min="0" 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 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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in strategies | 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 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/openchannel/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-globe"></i>\n                                            <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | 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                                        <div class="btn-group">\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>\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/openchannel/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/openchannel/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-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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/openchannel/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.channels -->\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 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.channels.openchannel.queues.view.settings\')}">\n                                          <a data-ng-href="/channels/openchannel/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.openchannel.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/openchannel/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.channels -->\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/openchannel/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 && updateQueue()" 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 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                                    <!-- START TIMEOUT -->\n                                        <div class="form-group">\n                                              <label class="control-label">Timeout</label>\n                                          <input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n                                        </div>\n                                        <!-- END TIMEOUT -->\n\n                                        <!-- START HEADER SHAPE -->\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.toUpperCase()}}</ui-select-match>\n                                                     <ui-select-choices repeat="strategy in strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | highlight: $select.search"></div>\n                                                   </ui-select-choices>\n                                          </ui-select>\n                                  </div>\n                                        <!-- END HEADER SHAPE -->\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/openchannel/inbox/room/room.directive.html",'<!-- BEGIN TODO CONTENT -->\n\n<div class="todo-content">\n   <div class="portlet light">\n           <div class="portlet-title">\n                   <div class="caption">\n                         <button class="btn btn-sm btn-default green-meadow" data-ng-if="Room.status !== \'CLOSED\'" data-ng-disabled="!form.body || forms.compose.from.$invalid || forms.compose.to.$invalid" data-ng-click="sendMessage()">\n                                  <i class="icon-paper-plane" style="color: white;"></i> {{\'APPLICATION_SEND\' | translate}}\n                           </button>\n                             <span data-ng-show="Room && Room.status !== \'CLOSED\'"> | </span>\n                            <span data-ng-show="Room" class="label label-default">#{{Room.id}} {{Room.status}}</span>\n                             <span data-ng-if="Room && Room.ParentId"> | </span>\n                           <span data-ng-if="Room && Room.ParentId" class="label label-warning"> Ref: <a data-ng-click="openRoom(Room.ParentId,Room.contact)">#{{Room.ParentId}}</a></span>\n                      </div>\n                        <div class="actions" data-ng-switch="Room.status">\n                            <button class="btn btn-icon-only" data-ng-show="Room"  data-ng-class="{\'btn-success\':Room.status !== \'CLOSED\',\'grey-cascade\':Room.status === \'CLOSED\'}" data-ng-click="closeRoom(Room.id)"  data-ng-disabled="Room.status === \'CLOSED\' && Room.disposition">\n                                        <i data-ng-class="{\'fa fa-upload\':Room.status !== \'CLOSED\',\'icon-target\':Room.status === \'CLOSED\'}"></i>\n                              </button>\n                             <button  class="btn default btn-icon-only" data-ng-if="Room && Room.status !== \'CLOSED\'" type="button" 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-show="panelLeft" data-ng-class="panelLeft">\n                                      <div class="form">\n                                            <!-- START TAGS -->\n                                           <div class="form-group" data-ng-if="Room.status !== \'CLOSED\' || (Room.status == \'CLOSED\' && form.tags.length)">\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 data-ng-disabled="Room.status == \'CLOSED\'"  multiple data-ng-model="form.tags" theme="bootstrap" on-select="onChanged($item, $model)" on-remove="onChanged($item, $model)">\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                                        <hr data-ng-if="Room && Room.status !== \'CLOSED\'">\n\n                                        <div ng-scrollbars ng-scrollbars-config="{\n                                            autoHideScrollbar: false,\n                                             theme: \'light\',\n                                             advanced: {\n                                                   updateOnContentResize: true\n                                           },\n                                            setHeight: 781,\n                                               scrollInertia: 0\n                                      }">\n                                           <ul class="chats">\n                                                    <li data-ng-switch="Room.status" data-ng-class="{\'in\': Message.status == \'RECEIVED\', \'out\': Message.status == \'SENT\' || Message.status == \'SENDING\' || Message.status == \'FAILED\' || Message.status == \'NOTE\'  || Message.status == \'DELIVERED\' || Message.status == \'QUEUED\' ||  Message.status != \'RECEIVED\' }" data-ng-repeat="Message in Room.OpenchannelMessages | orderBy:\'-createdAt\'">\n                                                          <!-- <img class="avatar" alt="" data-ng-src="api/users/avatar/{{getCurrentUser().userpic && smsMessage.status === \'SENT\' ? getCurrentUser().userpic : \'unknown_avatar\'}}"> -->\n                                                            <!-- <note message="smsMessage" ng-switch-when="NOTE"></note> -->\n                                                             <div class="avatar" data-ng-class="Message.UserId ? \'pretty-avatar\' : \'pretty-avatar-v\'">\n                                                                 <ng-letter-avatar\n                                                                     data-ng-if="Message.UserId"\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.UserId"\n                                                                  height="40"\n                                                                   width="40"\n                                                                    fontsize="25"\n                                                                 data="{{Message.from}}"\n                                                                       avatarcustombgcolor="#B0B0B0"\n                                                                 avatarcustomborder="border:2px solid #EA4C61"\n                                                                 charCount="1"\n                                                                 shape="round"></ng-letter-avatar>\n                                                             </div>\n                                                                <message message="Message" list-id="Room.OpenchannelAccount.ListId"  ng-switch-default></message>\n                                                     </li>\n                                         </ul>\n                                 </div>\n                                </div>\n                                <div data-ng-class="panelRight">\n\n                                    <div class="note note-info" data-ng-if="Room && Room.status == \'CLOSED\'">\n                                           <h4 class="block">Info! {{\'MESSAGE_ROOM_CLOSED\' | translate}}</h4>\n                                          <p>\n                                                   {{\'MESSAGE_ROOM_CLOSED_DETAILS\' | translate}}.\n                                              </p>\n                                          <hr>\n                                          <p>\n                                                   <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{Room.disposition}}</strong>\n                                                </p>\n                                          <p>\n                                                   <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{Room.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="Room.updatedAt"></span>)\n                                          </p>\n                                  </div>\n                                        <form  name="forms.compose" data-ng-submit="forms.compose.$valid" class="form-horizontal" novalidate>\n                                         <!-- START HEAD -->\n                                           <div class="form">\n\n                                                  <!-- START FROM -->\n                                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}" data-ng-if="Room.status !== \'CLOSED\'">\n                                                                             <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">From:</label>\n                                                                                            </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <ui-select  data-ng-disabled="Room"  theme="bootstrap" name="from" data-ng-model="form.from" required>\n                                                                                                                <ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n                                                                                                            <ui-select-choices repeat="Account.name as Account in Accounts | filter: $select.search">\n                                                                                                                     <div data-ng-bind-html="Account.name | highlight: $select.search"></div>\n                                                                                                                      <small data-ng-bind-html="Account.name | highlight: $select.search"></small>\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span data-ng-show="forms.compose.from.$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                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END FROM -->\n                                                     <!-- START TO -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}" data-ng-if="Room.status !== \'CLOSED\'">\n\n                                                             <div class="col-md-12">\n                                                                       <div class="row">\n                                                                             <div class="col-md-1">\n                                                                                        <label class="control-label">To:</label>\n                                                                              </div>\n                                                                                <div class="col-md-11">\n                                                                                       <input type="text"   name="to" class="form-control todo-taskbody-taskdesc" placeholder="To..." rows="8"   data-ng-disabled="Room" data-ng-model="form.to" required>\n                                                                                   <span data-ng-show="forms.compose.to.$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                                                                </div>\n                                                        </div>\n                                                        <!-- END TO -->\n                                                       <!-- START CANNED -->\n                                                 <div class="form-group"  data-ng-if="Room.status !== \'CLOSED\'">\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                                                                        </div>\n                                                                </div>\n\n                                                      </div>\n                                                        <!-- END CANNED -->\n                                                   <!-- START message -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.compose.body.$invalid && forms.compose.$submitted}" data-ng-if=" Room.status !== \'CLOSED\'">\n                                                            <div class="col-md-12">\n                                                                       <textarea id="text" class="form-control maxlength-handler" rows="8"  name="body" data-ng-model="form.body"></textarea>\n                                                                        <span data-ng-show="forms.compose.body.$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                                                      <!-- END message -->\n                                          </div>\n                                        </form>\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n<!-- END TODO CONTENT -->\n"),a.put("app/channels/openchannel/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></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 ui-grid-selection ui-grid-exporter ui-grid-draggable-rows class="ui-grid-inbox">\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'),a.put("app/channels/openchannel/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/openchannel/inbox/view/view.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-globe"></i>\n          <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n                                   <i class="icon-note"></i>\n                                     <a href="/channels/openchannel/inbox/list">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                                </li>\n      </ul>\n    </div>\n  </div>\n</div>\n\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox" data-ng-init="initView()">\n   <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == Account.id}" data-ng-repeat="Account in Accounts">\n                             <a href="/channels/openchannel/inbox/view/account/{{Account.id}}/list" class="btn">\n                                   <i class="icon-notebook"></i> {{Account.name}}\n                                </a>\n        <b></b>\n                 </li>\n         </ul>\n </div>\n\n      <div class="col-md-9" >\n               <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view>\n                 <div class="note note-info">\n                          <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                      </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/openchannel/inbox/view/view.status.modal.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>\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</div>\n'),a.put("app/channels/openchannel/inbox/view/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'),a.put("app/channels/openchannel/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 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" min="0" 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 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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in strategies | 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 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/openchannel/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-globe"></i>\n                                            <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | 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                                        <div class="btn-group">\n                                               <a class="btn green-jungle" href="#" data-ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | 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/openchannel/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/openchannel/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-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-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | translate }}</a>\n                                        <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/openchannel/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.channels -->\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 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.channels.openchannel.queues.view.settings\')}">\n                                          <a data-ng-href="/channels/openchannel/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.openchannel.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/openchannel/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.channels -->\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/openchannel/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 && updateQueue()" 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 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                                    <!-- START TIMEOUT -->\n                                        <div class="form-group">\n                                              <label class="control-label">Timeout</label>\n                                          <input type="number" name="timeout" placeholder="Timeout" class="form-control" min="1" data-ng-model="queue.timeout"/>\n                                        </div>\n                                        <!-- END TIMEOUT -->\n\n                                        <!-- START HEADER SHAPE -->\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.toUpperCase()}}</ui-select-match>\n                                                     <ui-select-choices repeat="strategy in strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | highlight: $select.search"></div>\n                                                   </ui-select-choices>\n                                          </ui-select>\n                                  </div>\n                                        <!-- END HEADER SHAPE -->\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/openchannel/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/openchannel/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/openchannel/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/openchannel/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/openchannel/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-globe"></i>\n                                    <a href="#">{{ \'APPLICATION_OPEN_CHANNEL\' | 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.openchannel.realtime.view.agents\')}">\n                                                      <a href="/channels/openchannel/realtime/view/agents">\n                                                         {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.openchannel.realtime.view.applications\')}">\n                                                        <a href="/channels/openchannel/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/openchannel/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n        <div class="col-md-12">\n               <!-- START TABLE -->\n          <div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="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 PAGE CONTENT-->\n'),a.put("app/channels/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-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/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/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.name 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/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-energy"></i>\n                                   <a href="/channels/realtime/view/agents">{{ \'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.realtime.view.agents\')}">\n                                                          <a href="/channels/realtime/view/agents">\n                                                                     {{\'APPLICATION_AGENTS\' | translate}}\n                                                                </a>\n                                                  </li>\n                                         </ul>\n                                 </div>\n                    </nav>\n            </div>\n                <div ui-view></div>\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/sms/account/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="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/sms/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | 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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" href="/channels/sms/accounts/wizard">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | 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/sms/account/view/action/list/list.html",'<div class="row" data-ng-init="initActions()">\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_ACTIONS\' | translate}}</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                                               <a class="btn green-jungle" href="/channels/sms/accounts/view/{{account.id}}/actions/wizard" data-toggle="dropdown">\n                                                  <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACTION\' | 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        </div>\n</div>\n'),a.put("app/channels/sms/account/view/action/view/view.html",'\n<div class="row" data-ng-init="initAction()">\n       <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <form name="forms.settings" ng-submit="updateItem()" novalidate>\n                                      <!-- START APP -->\n                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                       </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END APP -->\n\n                                    <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                          <!-- START QUEUE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.SmsQueueId" name="queue" theme="bootstrap" required>\n                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/sms/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                        <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END QUEUE -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                          <!-- START AGENT -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$invalid}">\n                                                       <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                         </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                <h4 class="block">Warning!</h4>\n                <p>\n                  {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                </p>\n                <p>\n                  {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                </p>\n              </div>\n                                                       <span data-ng-show="(forms.settings.agent.$touched || forms.settings.$submitted) && forms.settings.agent.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END AGENT -->\n\n                                          <!-- START TIMEOUT -->\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                 <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                  </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                          <!-- START SENDMAIL -->\n                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.to.$touched || forms.settings.$submitted) && forms.settings.to.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                  <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" min="1" required/>\n                                                      <span data-ng-show="(forms.settings.to.$touched || forms.settings.$submitted) && forms.settings.to.$invalid && forms.settings.to.$error.required" class="help-block help-block-error">\n                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$invalid}">\n                                                 <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.template.$touched || forms.settings.$submitted) && forms.settings.template.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END SENDMAIL -->\n                                 </div>\n\n                                      <div class="app-settings" ng-slide-down="application.app === \'sendSms\'" lazy-render duration="1" data-ng-init="getSmsAccounts()">\n                                           <!-- START SENDSms -->\n                                                <div class="app-settings" ng-slide-down="application.app === \'sendSms\'" lazy-render duration="1">\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.to.$touched || forms.settings.$submitted) && forms.settings.to.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                          <input  type="text" ng-pattern="/^[\\+]?[0-9]+$/" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2"  required/>\n                                                               <span data-ng-show="(forms.settings.to.$touched || forms.settings.$submitted) && forms.settings.to.$invalid && forms.settings.to.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                              <ui-select-choices repeat="account.id as account in smsAccounts | filter: $select.search">\n                                                                    <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.settings.account.$touched || forms.settings.$submitted) && forms.settings.account.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.text.$touched || forms.text.$submitted) && forms.settings.text.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_TEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                 <textarea id="text" class="form-control maxlength-handler" maxlength="160"  name="text" data-ng-model="application.data6" required></textarea>\n                                                        <span data-ng-show="(forms.settings.text.$touched || forms.settings.$submitted) && forms.settings.text.$invalid && forms.settings.text.$error.required" class="help-block help-block-error">\n                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n\n                                              <!-- END SENDSms -->\n                                  </div>\n                                        <!-- START INTERVAL_TYPE -->\n                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$invalid}">\n                                           <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                               {{ intType.name | translate }}\n                                                        </ui-select-choices>\n                                          </ui-select>\n                                          <span data-ng-show="(forms.settings.intType.$touched || forms.settings.$submitted) && forms.settings.intType.$error.required" class="help-block help-block-error">\n                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                         </span>\n                                       </div>\n                                        <!-- END INTERVAL_TYPE -->\n\n                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                <!-- START TIME -->\n                                           <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                   <div class="input-group input-large">\n                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                             </fieldset>\n                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                     </div>\n                                                </div>\n                                                <!-- END TIME -->\n\n                                           <!-- START ALWAYS -->\n                                         <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                 <div class="input-group input-large">\n                                                         <label class="control-label pointer-cursor">\n                                                                  <input\n                                                                                bs-switch\n                                                                             data-ng-model="application.alwaysTime"\n                                                                                type="checkbox"\n                                                                               switch-active="{{ isActive }}"\n                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                switch-on-color="{{ onColor }}"\n                                                                               switch-off-color="{{ offColor }}"\n                                                                             switch-animate="{{ animate }}"\n                                                                                switch-size="{{ size }}"\n                                                                              switch-label="{{ label }}"\n                                                                            switch-icon="{{ icon }}"\n                                                                              switch-radio-off="{{ radioOff }}"\n                                                                             switch-label-width="{{ labelWidth }}"\n                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                               </label>\n                                                      </div>\n                                                </div>\n                                                <!-- END ALWAYS -->\n\n                                         <!-- START WEEKDAY -->\n                                                <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                        <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                {{ weekDay.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END WEEKDAY -->\n\n                                                <!-- START MONTHDAY -->\n                                               <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                       <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                               {{monthDay}}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTHDAY -->\n\n                                               <!-- START MONTH -->\n                                          <div class="form-group">\n                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                  <div class="input-group input-large">\n                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="input-group-addon">to</span>\n                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                {{ month.name | translate }}\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                  </div>\n                                                </div>\n                                                <!-- END MONTH -->\n                                    </div>\n\n                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                          <!-- START INTERVALS -->\n                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$invalid}">\n                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                    {{ interval.name}}\n                                                            </ui-select-choices>\n                                                  </ui-select>\n                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                                                               <h4 class="block">Warning!</h4>\n                                                               <p>\n                                                                   {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                                                           </p>\n                                                          <p>\n                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                                                           </p>\n                                                  </div>\n                                                        <span data-ng-show="(forms.settings.IntervalId.$touched || forms.settings.$submitted) && forms.settings.IntervalId.$error.required" class="help-block help-block-error">\n                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVALS -->\n\n                                      </div>\n                                        <button class="btn green-haze" type="submit">{{\'APPLICATION_UPDATE\' | translate}}</button>\n                          </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/sms/account/view/action/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n     <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-directions font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_ACTION\' | translate }} WIZARD</a> </span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n                                     <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.action.$valid)">\n                                           <form name="forms.action" novalidate>\n                                                 <!-- START APP -->\n                                                    <div class="form-group"  data-ng-class="{\'has-error\': forms.action.$submitted && forms.action.app.$invalid}">\n                                                               <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="application.app" name="app" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="app.value as app in apps | filter: $select.search">\n                                                                                <div ng-bind-html="app.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.action.$submitted && forms.action.app.$invalid" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APP -->\n\n                                                    <div class="app-settings" ng-slide-down="application.app === \'agent\'" lazy-render duration="1" data-ng-init="getAgents()">\n                                                          <!-- START AGENT -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.UserId" name="agent" theme="bootstrap" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.fullname}}</ui-select-match>\n                                                                          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n                                                                                     <div ng-bind-html="agent.fullname | highlight: $select.search"></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="agents.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_AGENTS_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/staff/agents/list">{{\'APPLICATION_AGENTS\' | translate}}</a>\n                       </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.agent.$touched || forms.action.$submitted) && forms.action.agent.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END AGENT -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                        </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'queue\'" lazy-render duration="1" data-ng-init="getQueues()">\n                                                          <!-- START QUEUE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.SmsQueueId" name="queue" theme="bootstrap" required>\n                                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.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 class="note note-warning" data-ng-hide="queues.length">\n                    <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                   </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/sms/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                        </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.queue.$touched || forms.action.$submitted) && forms.action.queue.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE -->\n\n                                                          <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                     <input type="number" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="application.timeout" min="1" required/>\n                                                                 <span data-ng-show="(forms.action.timeout.$touched || forms.action.$submitted) && forms.action.timeout.$invalid && forms.action.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                                                  </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1" data-ng-init="getMailAccounts();getTemplates()">\n                                                          <!-- START SENDMAIL -->\n                                                               <div class="app-settings" ng-slide-down="application.app === \'sendMail\'" lazy-render duration="1">\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.to.$touched || forms.action.$submitted) && forms.action.to.$invalid}">\n                                                                           <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input type="email" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2" required/>\n                                                                              <span data-ng-show="(forms.action.to.$touched || forms.action.$submitted) && forms.action.to.$invalid && forms.action.to.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.action.mail.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in mailAccounts | filter: $select.search">\n                                                                                   <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEMPLATE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <ui-select data-ng-model="application.data9" name="template" theme="bootstrap" required>\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n                                                                                    <div ng-bind-html="template.name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.template.$touched || forms.action.$submitted) && forms.action.template.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END SENDMAIL -->\n                                                 </div>\n                                                        <div class="app-settings" ng-slide-down="application.app === \'sendSms\'" lazy-render duration="1" data-ng-init="getSmsAccounts()">\n                                                           <!-- START SENDSms -->\n                                                                <div class="app-settings" ng-slide-down="application.app === \'sendSms\'" lazy-render duration="1">\n                                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.action.to.$touched || forms.action.$submitted) && forms.action.to.$invalid}">\n                                                                           <label class="control-label">{{\'APPLICATION_TO\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                          <input  type="text" ng-pattern="/^[\\+]?[0-9]+$/" name="to" placeholder="{{\'APPLICATION_TO\' | translate}}" class="form-control" data-ng-model="application.data2"  required/>\n                                                                               <span data-ng-show="(forms.action.to.$touched || forms.action.$submitted) && forms.action.to.$invalid && forms.action.to.$error.required" 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 class="form-group" data-ng-class="{\'has-error\': (forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_ACCOUNT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                      <ui-select data-ng-model="application.data8" name="account" theme="bootstrap" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="account.id as account in smsAccounts | filter: $select.search">\n                                                                                    <div ng-bind-html="account.name | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.action.account.$touched || forms.action.$submitted) && forms.action.account.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.action.text.$touched || forms.action.$submitted) && forms.action.text.$invalid}">\n                                                                       <label class="control-label">{{\'APPLICATION_TEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                 <textarea id="text" class="form-control maxlength-handler"  maxlength="160" name="text" data-ng-model="application.data6" required></textarea>\n                                                                        <span data-ng-show="(forms.action.text.$touched || forms.action.$submitted) && forms.action.text.$invalid && forms.action.text.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n\n                                                              <!-- END SENDSms -->\n                                                  </div>\n                                                        <!-- START INTERVAL_TYPE -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$invalid}">\n                                                         <label class="control-label">{{ \'APPLICATION_INTERVAL_TYPE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="application.intType" theme="bootstrap" name="intType" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                        <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                               {{ intType.name | translate }}\n                                                                        </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.action.intType.$touched || forms.action.$submitted) && forms.action.intType.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVAL_TYPE -->\n\n                                                  <div class="app-settings" ng-slide-down="application.intType === \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="application.alwaysTime">\n                                                                                     <uib-timepicker name="t_from" data-ng-model="application.t_from" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker>\n                                                                             </fieldset>\n                                                                           <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="application.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="application.t_to" show-meridian="false" show-spinners="false" mousewheel="false"></uib-timepicker></fieldset>\n                                                                              <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="application.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                     </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                                bs-switch\n                                                                                             data-ng-model="application.alwaysTime"\n                                                                                                type="checkbox"\n                                                                                               switch-active="{{ isActive }}"\n                                                                                                switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                switch-on-color="{{ onColor }}"\n                                                                                               switch-off-color="{{ offColor }}"\n                                                                                             switch-animate="{{ animate }}"\n                                                                                                switch-size="{{ size }}"\n                                                                                              switch-label="{{ label }}"\n                                                                                            switch-icon="{{ icon }}"\n                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                      <!-- <input type="checkbox" data-ng-model="application.alwaysTime"> -->\n                                                                               </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.wd_from" theme="bootstrap" name="wd_from">\n                                                                                      <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate}}\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.wd_to" theme="bootstrap" name="wd_to">\n                                                                                  <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{ weekDay.name | translate }}\n                                                                                        </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.md_from" theme="bootstrap" name="md_from">\n                                                                                      <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.md_to" theme="bootstrap" name="md_to">\n                                                                                  <ui-select-match>{{$select.selected}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="application.m_from" theme="bootstrap" name="m_from">\n                                                                                        <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="application.m_to" theme="bootstrap" name="m_to">\n                                                                                    <ui-select-match placeholder="">{{ $select.selected.name | translate }}</ui-select-match>\n                                                                                     <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{ month.name | translate }}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div class="app-settings" ng-slide-down="application.intType === \'list\'" lazy-render duration="1" data-ng-init="getIntervals()">\n\n                                                          <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="application.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{ $select.selected.name}}</ui-select-match>\n                                                                             <ui-select-choices repeat="interval.id as interval in intervals | filter: $select.search">\n                                                                                    {{ interval.name}}\n                                                                            </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                         </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.action.IntervalId.$touched || forms.action.$submitted) && forms.action.IntervalId.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n\n                                                      <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONTINUE\' | translate}}"/>\n                                         </form>\n                                       </wz-step>\n                                    <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input class="btn green-haze" type="submit" data-ng-click="next()" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                  </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/sms/account/view/api/view/view.html",'<div class="row" data-ng-init="initView()">\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_API\' | translate}}</span>\n                             </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- CALLBACK TAB -->\n                                 <div class="tab-pane active" id="tab_1_1">\n                                                    <!-- START CALLBACK URL -->\n                                                   <div  class="row" >\n                                                                   <div class="col-md-12">\n                                                                               <label class="control-label">Receive URL</label>\n                                                                              <p>\n                                                                                   Copy the following url and insert it into your {{account.type}} account settings to receive SMS.\n                                                                                      <a href="https://wiki.xcallymotion.com/display/XMD/SMS" target="_blank">Detail</a>\n                                                                            </p>\n                                                                  </div>\n                                                                </div>\n                                                        <div   class="row" >\n                                                                  <div class="col-md-11">\n                                                                               <code-mirror  model="receiveurl"></code-mirror>\n                                                                       </div>\n                                                                        <div class="col-md-1">\n                                                                                <a class="btn btn-sm green-jungle" data-ng-click="copyToClipboard(receiveurl);"><i class="fa fa-clipboard"></i>\n                                                                               </a>\n                                                                  </div>\n                                                        </div><br>\n                                                    <!-- END CALLACK URL -->\n                                                      <!-- START DELIVERY CALLBACK URL -->\n                                                  <div ng-if= "account.smstype == \'classic+\'" class="row"  ng-show="!forms.info.remote.$invalid">\n                                                             <div class="col-md-12">\n                                                                       <label class="control-label">Delivery URL </label>\n                                                                    <p>\n                                                                           Copy the following url and insert it into your {{account.type}} account settings to receive delivery report.\n                                                                   <a href="https://wiki.xcallymotion.com/display/XMD/SMS" target="_blank">Detail</a>\n                                                                   </p>\n                                                          </div>\n                                                        </div>\n                                                        <div ng-if= "account.smstype == \'classic+\'"  class="row" ng-show="!forms.info.remote.$invalid">\n                                                             <div class="col-md-11">\n                                                                       <code-mirror class="control-label" model="deliveryurl"></code-mirror>\n                                                         </div>\n                                                                <div class="col-md-1">\n                                                                        <a class="btn btn-sm green-jungle" data-ng-click="copyToClipboard(deliveryurl);"><i class="fa fa-clipboard"></i>\n                                                                      </a>\n                                                          </div>\n                                                        </div>\n                                                        <!-- END DELIVERY CALLACK URL -->\n                                     </div>\n                                        <!-- END CALLBACK TAB -->\n                             </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/sms/account/view/disposition/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$error.required" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n        </span>\n      </div>\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/sms/account/view/disposition/view/view.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_DISPOSITIONS\' | translate}}</span>\n                            </div>\n                                <div class="actions actions-md">\n                                      <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body" data-ng-init="initView()">\n                          <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/sms/account/view/hooks/view/view.html",'<div class="row" data-ng-init="initView()">\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_HOOKS\' | 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_ACCEPT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_REJECT\' | translate}}</a>\n                                       </li>\n                                 <li >\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_CLOSE\' | translate}}</a>\n                                        </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- ACCEPT TAB -->\n                                   <div class="tab-pane active" id="tab_1_1">\n                                            <form name="forms.accept" data-ng-submit="forms.accept.$valid && updateItemSmsAccount()" novalidate>\n                                                  <!-- START ACCEPT URL -->\n                                                             <div class="row">\n                                                                     <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid}">\n                                                                          <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                           <ui-select data-ng-model="account.acceptMethod" name="method" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                                 <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                             <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                                 </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.accept.method.$touched || forms.accept.$submitted) && forms.accept.method.$invalid && forms.accept.method.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <div  class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid}">\n                                                                               <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                              <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.acceptUrl"  ng-required="account.acceptMethod"/>\n                                                                           <span data-ng-show="(forms.accept.url.$touched || forms.accept.$submitted) && forms.accept.url.$invalid && forms.accept.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                </div>\n                                                                <!-- END ACCEPT URL-->\n                                                                <!-- START ACTIONS-->\n                                                         <!-- START PAUSE -->\n                                                          <div class="row" ng-repeat = "action in account.actions">\n                                                                     <div  ng-switch="action.action">\n                                                                                      <div ng-switch-when="pause">\n                                                                                          <div  class="form-group col-md-4">\n                                                                                                    <label class="control-label">{{\'APPLICATION_PAUSE\' | translate}}</label></br>\n                                                                                                               <input\n                                                                                                                bs-switch\n                                                                                                             data-ng-change="resetActionData(action)"\n                                                                                                              data-ng-model="action.enabled"\n                                                                                                                type="checkbox"\n                                                                                                               switch-active="{{ isActive }}"\n                                                                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                                                                          switch-on-color="{{ onColor }}"\n                                                                                                               switch-off-color="{{ offColor }}"\n                                                                                                             switch-animate="{{ animate }}"\n                                                                                                                switch-size="{{ size }}"\n                                                                                                              switch-label="{{ label }}"\n                                                                                                            switch-icon="{{ icon }}"\n                                                                                                              switch-radio-off="{{ radioOff }}"\n                                                                                                             switch-label-width="{{ labelWidth }}"\n                                                                                                         switch-handle-width="{{ handleWidth }}">\n                                                                                                      </div>\n                                                                                                        <div ng-if="action.enabled" class="form-group col-md-8">\n                                                                                                              <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                                                             <ui-select  name="action" data-ng-model="action.type"  theme="bootstrap" >\n                                                                                                                    <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                                                       <ui-select-choices repeat=" pause.name as pause in pauses | filter: $select.search">\n                                                                                                                          <div ng-bind-html="pause.name | highlight: $select.search | uppercase" ></div>\n                                                                                                                        </ui-select-choices>\n                                                                                                          </ui-select>\n                                                                                                  </div>\n                                                                                        </div>\n                                                                                </div>\n                                                                        </div>\n                                                                <!-- END ACTION -->\n\n                                                         <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END ACCEPT TAB -->\n                                       <!-- START REJECT TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.reject" data-ng-submit="forms.reject.$valid && updateItemSmsAccount()" novalidate>\n                                                  <!-- START REJECT URL -->\n                                                     <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.rejectMethod" name="method" theme="bootstrap" >\n                                                                             <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.reject.method.$touched || forms.reject.$submitted) && forms.reject.method.$invalid && forms.reject.method.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid}">\n                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.rejectUrl" ng-required="account.rejectMethod"/>\n                                                                    <span data-ng-show="(forms.reject.url.$touched || forms.reject.$submitted) && forms.reject.url.$invalid && forms.reject.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n\n                                                      <!-- END REJECT URL -->\n                                                               <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END REJECT TAB -->\n                                       <!-- START CLOSE TAB -->\n                                      <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.close" data-ng-submit="forms.close.$valid && updateItemSmsAccount()" novalidate>\n                                                    <div class="row">\n                                                             <div class="form-group col-md-4" data-ng-class="{\'has-error\': (forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_METHOD\' | translate}}</label>\n                                                                   <ui-select data-ng-model="account.closeMethod" name="method" theme="bootstrap" >\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_METHOD\' | translate}}">{{$select.selected.name | uppercase}}</ui-select-match>\n                                                                         <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n                                                                                     <div ng-bind-html="type.name | highlight: $select.search | uppercase" ></div>\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.close.method.$touched || forms.close.$submitted) && forms.close.method.$invalid && forms.close.method.$error.required" class="help-block help-block-error">\n                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <div class="form-group col-md-8" data-ng-class="{\'has-error\': (forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                                                                      <input type="url" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="account.closeUrl" ng-required="account.closeMethod"/>\n                                                                      <span data-ng-show="(forms.close.url.$touched || forms.close.$submitted) && forms.close.url.$invalid && forms.close.url.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                        </div>\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END CLOSE TAB -->\n                                </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
 a.put("app/channels/sms/account/view/setting/view/view.html",'<div class="row" data-ng-init="initView()">\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                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\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.info" data-ng-submit="forms.info.$valid && updateItemSmsAccount()" novalidate>\n                                                      <!-- START ID -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ID\' | translate}}<span class="required" aria-required="true">*</span>\n                                                           </label>\n                                                              <input type="text" name="id" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.id" ng-disabled="true" required/>\n                                                 </div>\n                                                        <!-- END ID-->\n                                                        <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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="account.name" required/>\n                                                                <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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                                                     <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.ListId" name="list" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.ListId = null" class="btn btn-default">\n                                                                                          <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\n                                                     <!-- START FIDELITY -->\n                                                       <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             data-ng-model="account.fidelity"\n                                                              type="checkbox"\n                                                               switch-active="{{ isActive }}"\n                                                                switch-on-text="{{ \'APPLICATION_ENABLED\' | translate }}"\n                                                            switch-off-text="{{ \'APPLICATION_DISABLED\' | translate }}"\n                                                          switch-on-color="{{ onColor }}"\n                                                               switch-off-color="{{ offColor }}"\n                                                             switch-animate="{{ animate }}"\n                                                                switch-size="{{ size }}"\n                                                              switch-label="{{ label }}"\n                                                            switch-icon="{{ icon }}"\n                                                              switch-radio-off="{{ radioOff }}"\n                                                             switch-label-width="{{ labelWidth }}"\n                                                         switch-handle-width="{{ handleWidth }}">\n                                                      </div>\n                                                        <!-- END FIDELITY -->\n\n                                                       <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n                                                                <span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$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.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n                                                      <!-- START TWILIO -->\n                                                 <!-- START PHONE -->\n                                                  <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" ng-pattern="/^[\\+]?[0-9]+$/" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" name="phone" required/>\n                                                               <span data-ng-show="(forms.info.phone.$touched || forms.in.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PHONE  -->\n\n                                                 <!-- START SID -->\n                                                    <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.sid.$touched || forms.info.$submitted) && forms.info.sid.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SID\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                          <input type="text" name="sid" placeholder="{{\'APPLICATION_SID\' | translate}}" class="form-control" data-ng-model="account.sid" name="sid" required/>\n                                                                <span data-ng-show="(forms.info.sid.$touched || forms.info.$submitted) && forms.info.sid.$invalid && forms.info.sid.$error.required"  class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SID -->\n                                                      <!-- START TOKEN -->\n                                                  <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_TOKEN\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="account.token" name="token" required/>\n                                                                <span data-ng-show="(forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid && forms.info.token.$error.required"  class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SID -->\n                                                      <!-- END TWILIO -->\n                                                   <!-- START SKEBBY -->\n                                                 <!-- START SKEBBY SMS TYPE -->\n                                                <div ng-if= " account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid}">\n                                                  <label class="control-label">{{\'APPLICATION_SMS_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="account.smstype" name="smstype" theme="bootstrap" required>\n                                                         <ui-select-match placeholder="{{\'SMS_TYPE\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n                                                                <ui-select-choices repeat="smstype in [\'basic\',\'classic\',\'classic+\'] | filter: $select.search">\n                                                                 <div data-ng-bind="smstype | highlight: $select.search | uppercase" ></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid && forms.info.smstype.$error.required" class="help-block help-block-error">\n                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                        <!-- END SKEBBY SMS TYPE -->\n                                                  <!-- START PHONE  -->\n                                                 <div ng-if= "account.type == \'skebby\'  " class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true"></span></label>\n                                                         <input type="text" ng-pattern="/^[0-9]+$/"  placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" name="phone" required/>\n                                                            <span class="help-block">\n                                                                     {{ \'DESCRIPTION_PHONE_NUMBER\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.info.phone.$touched || forms.in.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PHONE -->\n                                                    <!-- START USERNAME -->\n                                                       <div ng-if= "account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" name="username" required/>\n                                                            <span data-ng-show="(forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid && forms.info.username.$error.required"  class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div ng-if= "account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n                                                                <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid && forms.info.password.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n                                                 <!-- END SKEBBY -->\n                                                   <!-- START REMOTE IP -->\n                                                      <div  class="form-group" data-ng-class="{\'has-error\': (forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remote" required/>\n                                                           <span class="help-block help-block-info">\n                                                                     {{\'MESSAGE_MOTION_ADDRESS_FORMAT\' | translate}}\n                                                             </span>\n                                                               <span data-ng-show="(forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid && forms.info.remote.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END REMOTE IP -->\n                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/sms/account/view/view.html",'<!-- BEGIN PAGE HEADER-->\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="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/sms/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                                  <i class="fa fa-angle-right" data-ng-show="account"></i>\n                              </li>\n                         <li data-ng-show="account">\n                                   <a href="#">{{ account.description || account.name }}</a>\n                             </li>\n                 </ul>\n         </div>\n\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n               <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET main.channels -->\n                        <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img ng-src="assets/images/media/account.png" class="img-responsive">\n                         </div>\n                                <!-- END SIDEBAR USERPIC -->\n\n                                <!-- SIDEBAR USER TITLE -->\n                           <div class="profile-usertitle">\n                                       <div class="profile-usertitle-name">\n                                          {{ account.description || account.name }}\n                                     </div>\n                                        <div class="profile-usertitle-job">\n                                           {{account.email}}\n                                     </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n\n                             <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li ng-class="{active: $state.is(\'main.channels.sms.accounts.view.settings\')}">\n                                                     <a href="/channels/sms/accounts/view/{{account.id}}/settings">\n                                                        <i class="icon-settings"></i>\n                                                 {{\'APPLICATION_SETTINGS\' | translate}} </a>\n                                         </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.sms.accounts.view.api\')}">\n                                                  <a href="/channels/sms/accounts/view/{{account.id}}/api">\n                                                     <i class="fa fa-external-link"></i>\n                                                   {{\'APPLICATION_API\' | translate}} </a>\n                                              </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.sms.accounts.view.hooks\')}">\n                                                        <a href="/channels/sms/accounts/view/{{account.id}}/hooks">\n                                                   <i class="fa fa-code"></i>\n                                                    {{\'APPLICATION_HOOKS\' | translate}} </a>\n                                            </li>\n                                         <li ng-class="{active: $state.is(\'main.channels.sms.accounts.view.dispositions\')}">\n                                                 <a href="/channels/sms/accounts/view/{{account.id}}/dispositions">\n                                                    <i class="icon-target"></i>\n                                                   {{\'APPLICATION_DISPOSITIONS\' | translate}} </a>\n                                             </li>\n                                         <li ng-class="{active: $state.includes(\'main.channels.sms.accounts.view.actions\')}">\n                                                        <a href="/channels/sms/accounts/view/{{account.id}}/actions/list">\n                                                    <i class="icon-directions"></i>\n                                                       {{\'APPLICATION_ACTIONS\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <div ui-view class="profile-content"></div>\n           <!-- END PROFILE CONTENT -->\n  </div>\n<!-- END PAGE CONTENT-->\n</div>\n'),a.put("app/channels/sms/account/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                                <ul class="nav nav-tabs">\n                                     <li class="active">\n                                           <a href="#" data-target="#tab_1_1" data-toggle="tab">{{\'APPLICATION_GENERALS\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\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.info" data-ng-submit="forms.info.$valid && updateItemSmsAccount()" novalidate>\n                                                      <!-- START ID -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ID\' | translate}}<span class="required" aria-required="true">*</span>\n                                                           </label>\n                                                              <input type="text" name="id" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="account.id" ng-disabled="true" required/>\n                                                 </div>\n                                                        <!-- END ID-->\n                                                        <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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="account.name" required/>\n                                                                <span data-ng-show="(forms.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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                                                     <!-- START LIST -->\n                                                   <div class="form-group" data-ng-if="license.cm">\n                                                              <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                                                                     <div class="input-group">\n\n                                                                           <ui-select data-ng-model="account.ListId" name="list" theme="bootstrap">\n                                                                                      <ui-select-match placeholder="{{\'APPLICATION_LIST\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                                                                                                <div ng-bind-html="list.name | highlight: $select.search"></div>\n                                                                                      </ui-select-choices>\n                                                                          </ui-select>\n\n                                                                                <span class="input-group-btn">\n                                                                                        <button type="button" data-ng-click="account.ListId = null" class="btn btn-default">\n                                                                                          <span class="glyphicon glyphicon-trash"></span>\n                                                                                       </button>\n                                                                             </span>\n\n                                                                     </div>\n                                                        </div>\n                                                        <!-- END LIST -->\n\n\n                                                 <!-- START FIDELITY -->\n                                                       <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_FIDELITY\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          data-ng-model="account.fidelity"\n                                                              type="checkbox"\n                                                               name="auth"\n                                                           switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                 </div>\n                                                        <!-- END FIDELITY -->\n\n                                                       <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-if="account.fidelity" data-ng-class="{\'has-error\': (forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_PORT\' | translate}}" class="form-control" data-ng-model="account.timeout" required/>\n                                                                <span data-ng-show="(forms.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$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.info.timeout.$touched || forms.info.$submitted) && forms.info.timeout.$invalid && forms.info.timeout.$error.number" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_NUMERIC_FIELD\' | translate}}.\n                                                          </span>\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n\n                                                    <!-- START PHONE FOR TWILLIO ACCOUNT -->\n\n                                                    <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" ng-pattern="/^[\\+]?[0-9]+$/" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" name="phone" required/>\n<!-- Format with a \'+\' and country code  -->\n                                                               <!-- <span class="help-block">\n                                                                        {{ \'DESCRIPTION_PHONE_NUMBER\' | translate }}\n                                                                </span> -->\n                                                           <span data-ng-show="(forms.info.phone.$touched || forms.in.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PHONE FOR TWILLIO ACCOUNT -->\n\n                                                      <!-- START SID -->\n                                                    <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.sid.$touched || forms.info.$submitted) && forms.info.sid.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SID\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                          <input type="text" name="sid" placeholder="{{\'APPLICATION_SID\' | translate}}" class="form-control" data-ng-model="account.sid" name="sid" required/>\n                                                                <span data-ng-show="(forms.info.sid.$touched || forms.info.$submitted) && forms.info.sid.$invalid && forms.info.sid.$error.required"  class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SID -->\n                                                      <!-- START TOKEN -->\n                                                  <div ng-if= "account.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_TOKEN\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="account.token" name="token" required/>\n                                                                <span data-ng-show="(forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid && forms.info.token.$error.required"  class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SID -->\n\n                                                    <!-- START SMS TYPE -->\n\n                                             <div ng-if= " account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid}">\n                                                  <label class="control-label">{{\'APPLICATION_SMS_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                     <ui-select data-ng-model="account.smstype" name="smstype" theme="bootstrap" required>\n                                                         <ui-select-match placeholder="{{\'SMS_TYPE\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n                                                                <ui-select-choices repeat="smstype in [\'basic\',\'classic\',\'classic+\'] | filter: $select.search">\n                                                                 <div data-ng-bind="smstype | highlight: $select.search | uppercase" ></div>\n                                                           </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid && forms.info.smstype.$error.required" class="help-block help-block-error">\n                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                        <!-- END TYPE -->\n                                                     <!-- START PHONE FOR SKEBBY ACCOUNT -->\n                                                       <div ng-if= "account.type == \'skebby\'  " class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true"></span></label>\n                                                         <input type="text" ng-pattern="/^[0-9]+$/"  placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="account.phone" name="phone" required/>\n                                                            <span class="help-block">\n                                                                     {{ \'DESCRIPTION_PHONE_NUMBER\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.info.phone.$touched || forms.in.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PHONE -->\n                                                    <!-- START USERNAME -->\n                                                       <div ng-if= "account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" name="username" required/>\n                                                            <span data-ng-show="(forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid && forms.info.username.$error.required"  class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START PASSWORD -->\n                                                       <div ng-if= "account.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n                                                                <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid && forms.info.password.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n                                                 <!-- START REMOTE IP -->\n                                                      <div  class="form-group" data-ng-class="{\'has-error\': (forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remote" required/>\n                                                           <span data-ng-show="(forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid && forms.info.remote.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END REMOTE IP -->\n                                                        <!-- START CALLBACK URL -->\n                                                   <div  ng-show="!forms.info.remote.$invalid" class="row" >\n                                                             <!-- <div class="row"> -->\n                                                                    <div class="col-md-12">\n                                                                               <label class="control-label">URL </label><br>\n                                                                         <span ng-if= "account.type == \'twilio\' || account.type == \'skebby\'">\n                                                                                      Copy the following url and insert it into your {{account.type}} account settings to receive sms.\n                                                                                      <a href="https://wiki.xcallymotion.com/display/XMD/SMS" target="_blank">Detail</a>\n                                                                            </span>\n                                                                       </div>\n                                                                </div>\n                                                                <br>\n                                                  <div  ng-show="!forms.info.remote.$invalid" class="row" >\n                                                                     <div class="col-md-11">\n                                                                               <code-mirror  model="receiveurl"></code-mirror>\n                                                                       </div>\n                                                                        <div class="col-md-1">\n                                                                                <a class="btn btn-sm green-jungle" data-ng-click="copyToClipboard(receiveurl);"><i class="fa fa-clipboard"></i>\n                                                                               </a>\n                                                                  </div>\n                                                        </div>\n                                                        <!-- END CALLACK URL -->\n                                                      <!-- START DELIVERY CALLBACK URL -->\n                                                  <div ng-if= "account.smstype == \'classic+\'" class="row"  ng-show="!forms.info.remote.$invalid">\n                                                             <div class="col-md-12">\n                                                                       <label class="control-label">Delivery URL </label><br>\n                                                                         Copy the following url and insert it into your {{account.type}} account settings to receive delivery status.\n                                                                  <a href="https://wiki.xcallymotion.com/display/XMD/SMS" target="_blank">Detail</a>\n                                                           </div>\n                                                        </div>\n                                                                        <br>\n                                                  <div ng-if= "account.smstype == \'classic+\'"  class="row" ng-show="!forms.info.remote.$invalid">\n                                                             <div class="col-md-11">\n                                                                       <code-mirror class="control-label" model="deliveryurl"></code-mirror>\n                                                         </div>\n                                                                <div class="col-md-1">\n                                                                        <a class="btn btn-sm green-jungle" data-ng-click="copyToClipboard(deliveryurl);"><i class="fa fa-clipboard"></i>\n                                                                      </a>\n                                                          </div>\n                                                        </div>\n                                                        <!-- END DELIVERY CALLACK URL -->\n                                                             <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
 a.put("app/channels/sms/account/wizard/wizard.html",'\n<div class="row" data-ng-init="initWizard()">\n <div class="col-md-12">\n               <!-- BEGIN PAGE HEADER-->\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="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-notebook"></i>\n                                 <a href="/channels/sms/accounts/list">{{ \'APPLICATION_ACCOUNTS\' | translate }}</a>\n                          </li>\n                 </ul>\n         </div>\n                <!-- END PAGE HEADER-->\n\n             <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n             <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="formValidation(forms.info.$valid)">\n                                                    <form name="forms.info" novalidate>\n                                                           <!-- START NAME -->\n                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.info.name.$touched || forms.info.$submitted) && forms.info.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.info.name.$touched || forms.info.$submitted) && forms.info.name.$invalid && forms.info.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                                                                      <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n                                                               </div>\n                                                                <!-- END DESCRIPTION -->\n                <!-- START APPLICATION TYPE -->\n\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.info.type.$touched || forms.info.$submitted) && forms.info.type.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <ui-select data-ng-model="item.type" name="type" theme="bootstrap" required>\n                              <ui-select-match placeholder="{{\'APPLICATION_TYPE\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n                                <ui-select-choices repeat="type in [\'twilio\',\'skebby\'] | filter: $select.search">\n                                   <div data-ng-bind="type | highlight: $select.search | uppercase" ></div>\n                                    </ui-select-choices>\n                                </ui-select>\n                                                                <span data-ng-show="(forms.info.type.$touched || forms.info.$submitted) && forms.info.type.$invalid && forms.info.type.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                <!-- END TYPE -->\n                                                             <!-- START PHONE FOR TWILLIO ACCOUNT -->\n                                                              <div ng-if= "item.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                                  <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <input type="text" ng-pattern="/^[\\+]?[0-9]+$/"  placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="item.phone" name="phone" required/>\n                                                                 <span data-ng-show="(forms.info.phone.$touched || forms.info.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END PHONE FOR TWILLIO ACCOUNT -->\n                <!-- START SID -->\n                <div ng-if= "item.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': ( forms.info.sid.$touched ||forms.info.$submitted) && forms.info.sid.$invalid}">\n                  <label class="control-label">{{\'APPLICATION_SID\' | translate}}<span class="required" aria-required="true">*</span></label>\n                  <input type="text"  placeholder="{{\'APPLICATION_SID\' | translate}}" class="form-control" data-ng-model="item.sid" name="sid" required/>\n                  <span data-ng-show="(forms.info.sid.$touched || forms.info.$submitted) && forms.info.sid.$invalid && forms.info.sid.$error.required"  class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <!-- END SID -->\n                <!-- START TOKEN -->\n                <div ng-if= "item.type == \'twilio\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid}">\n                  <label class="control-label">{{\'APPLICATION_TOKEN\' | translate}}<span class="required" aria-required="true">*</span></label>\n                  <input type="text"  placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="item.token" name="token" required/>\n                  <span data-ng-show="(forms.info.token.$touched || forms.info.$submitted) && forms.info.token.$invalid && forms.info.token.$error.required"  class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <!-- END SID -->\n\n                                                                <!-- START SMS TYPE -->\n                                                       <div ng-if= " item.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_SMS_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <ui-select data-ng-model="item.smstype" name="smstype" theme="bootstrap" required>\n                                                                    <ui-select-match placeholder="{{\'SMS_TYPE\' | translate}}">{{$select.selected | uppercase}}</ui-select-match>\n                                                                        <ui-select-choices repeat="smstype in [\'basic\',\'classic\',\'classic+\'] | filter: $select.search">\n                                                                         <div data-ng-bind="smstype | highlight: $select.search | uppercase" ></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.info.smstype.$touched || forms.info.$submitted) && forms.info.smstype.$invalid && forms.info.smstype.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                                <!-- END TYPE -->\n                                                             <!-- START PHONE FOR SKEBBY ACCOUNT -->\n                                                       <div ng-if= "item.type == \'skebby\' " class="form-group" data-ng-class="{\'has-error\': ( forms.info.phone.$touched ||forms.info.$submitted) && forms.info.phone.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true"></span></label>\n                                                         <input type="text" ng-pattern="/^[0-9]+$/"  placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="item.phone" name="phone" required/>\n                                                               <span class="help-block">\n                                                                     {{ \'DESCRIPTION_PHONE_NUMBER\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.info.phone.$touched || forms.info.$submitted) && forms.info.phone.$invalid && forms.info.phone.$error.required"  class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                                <!-- END PHONE -->\n                                                            <!-- START USERNAME -->\n                                                               <div ng-if= "item.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid}">\n                                                                    <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                     <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" name="username" required/>\n                                                                       <span data-ng-show="(forms.info.username.$touched || forms.info.$submitted) && forms.info.username.$invalid && forms.info.username.$error.required"  class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END USERNAME -->\n                <!-- START PASSWORD -->\n                <div ng-if= "item.type == \'skebby\'" class="form-group" data-ng-class="{\'has-error\': (forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid}">\n                  <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" aria-required="true">*</span></label>\n                  <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n                  <span data-ng-show="(forms.info.password.$touched || forms.info.$submitted) && forms.info.password.$invalid && forms.info.password.$error.required" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <!-- END PASSWORD -->\n                                                               <!-- START REMOTE IP -->\n                                                              <div ng-if= "item.type" class="form-group" data-ng-class="{\'has-error\': (forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid}">\n                                                                      <label class="control-label">{{\'APPLICATION_MOTION_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                      <input type="url" name="remote" placeholder="{{\'APPLICATION_MOTION_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remote" required/>\n                                                                      <span class="help-block help-block-info">\n                                                                             {{\'MESSAGE_MOTION_ADDRESS_FORMAT\' | translate}}\n                                                                     </span>\n                                                                       <span data-ng-show="(forms.info.remote.$touched || forms.info.$submitted) && forms.info.remote.$invalid && forms.info.remote.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END REMOTE IP -->\n                                                                <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n                                                       </form>\n                                               </wz-step>\n                                            <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                                   <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/sms/inbox/room/room.directive.html",'<!-- BEGIN TODO CONTENT -->\n\n<div class="todo-content">\n       <div class="portlet light">\n           <div class="portlet-title">\n                   <div class="caption">\n                         <button class="btn btn-sm btn-default green-meadow" data-ng-if="SmsRoom.status !== \'CLOSED\'" data-ng-disabled="!form.body || forms.compose.from.$invalid || forms.compose.to.$invalid" data-ng-click="sendSMS()">\n                                   <i class="icon-paper-plane" style="color: white;"></i> {{\'APPLICATION_SEND\' | translate}}\n                           </button>\n                             <span data-ng-show="SmsRoom && SmsRoom.status !== \'CLOSED\'"> | </span>\n                              <span data-ng-show="SmsRoom" class="label label-default">#{{SmsRoom.id}} {{SmsRoom.status}}</span>\n                            <span data-ng-if="SmsRoom && SmsRoom.ParentId"> | </span>\n                             <span data-ng-if="SmsRoom && SmsRoom.ParentId" class="label label-warning"> Ref: <a data-ng-click="openRoom(SmsRoom.ParentId,SmsRoom.contact)">#{{SmsRoom.ParentId}}</a></span>\n                       </div>\n                        <div class="actions" data-ng-switch="SmsRoom.status">\n                         <button class="btn btn-icon-only" data-ng-show="SmsRoom"  data-ng-class="{\'btn-success\':SmsRoom.status !== \'CLOSED\',\'grey-cascade\':SmsRoom.status === \'CLOSED\'}" data-ng-click="closeRoom(SmsRoom.id)"  data-ng-disabled="SmsRoom.status === \'CLOSED\' && SmsRoom.disposition">\n                                      <i data-ng-class="{\'fa fa-upload\':SmsRoom.status !== \'CLOSED\',\'icon-target\':SmsRoom.status === \'CLOSED\'}"></i>\n                                </button>\n                             <button  class="btn default btn-icon-only" data-ng-if="SmsRoom && SmsRoom.status !== \'CLOSED\'" type="button" 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-show="panelLeft" data-ng-class="panelLeft">\n                                      <div class="form">\n                                            <!-- START TAGS -->\n                                           <div class="form-group" data-ng-if="SmsRoom.status !== \'CLOSED\' || (SmsRoom.status == \'CLOSED\' && form.tags.length)">\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 data-ng-disabled="SmsRoom.status == \'CLOSED\'"  multiple data-ng-model="form.tags" theme="bootstrap" on-select="onChanged($item, $model)" on-remove="onChanged($item, $model)">\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                                        <hr data-ng-if="SmsRoom && SmsRoom.status !== \'CLOSED\'">\n\n                                  <div ng-scrollbars ng-scrollbars-config="{\n                                            autoHideScrollbar: false,\n                                             theme: \'light\',\n                                             advanced: {\n                                                   updateOnContentResize: true\n                                           },\n                                            setHeight: 781,\n                                               scrollInertia: 0\n                                      }">\n                                           <ul class="chats">\n                                                    <li data-ng-switch="SmsRoom.status" data-ng-class="{\'in\': smsMessage.status == \'RECEIVED\', \'out\': smsMessage.status == \'SENT\' || smsMessage.status == \'SENDING\' || smsMessage.status == \'FAILED\' || smsMessage.status == \'NOTE\'  || smsMessage.status == \'DELIVERED\' || smsMessage.status == \'QUEUED\' ||  smsMessage.status != \'RECEIVED\' }" data-ng-repeat="smsMessage in SmsRoom.SmsMessages | orderBy:\'-createdAt\'">\n                                                         <div class="avatar" data-ng-class="smsMessage.UserId ? \'pretty-avatar\' : \'pretty-avatar-v\'">\n                                                                      <ng-letter-avatar\n                                                                     data-ng-if="smsMessage.UserId"\n                                                                        height="40"\n                                                                   width="40"\n                                                                    fontsize="25"\n                                                                 data="{{smsMessage.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="!smsMessage.UserId"\n                                                                       height="40"\n                                                                   width="40"\n                                                                    fontsize="25"\n                                                                 data="{{smsMessage.from}}"\n                                                                    avatarcustombgcolor="#B0B0B0"\n                                                                 avatarcustomborder="border:2px solid #EA4C61"\n                                                                 charCount="1"\n                                                                 shape="round"></ng-letter-avatar>\n                                                             </div>\n                                                                <sms message="smsMessage" list-id="SmsRoom.SmsAccount.ListId" accounttype=\'SmsRoom.SmsAccount.type\' ng-switch-default></sms>\n                                                        </li>\n                                         </ul>\n                                 </div>\n                                </div>\n                                <div data-ng-class="panelRight">\n                                      <div class="note note-info" data-ng-if="SmsRoom && SmsRoom.status == \'CLOSED\'">\n                                             <h4 class="block">Info! {{\'MESSAGE_SMS_ROOM_CLOSED\' | translate}}</h4>\n                                              <p>\n                                                   {{\'MESSAGE_SMS_ROOM_CLOSED_DETAILS\' | translate}}.\n                                          </p>\n                                          <hr>\n                                          <p>\n                                                   <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}: <strong>{{SmsRoom.disposition}}</strong>\n                                             </p>\n                                          <p>\n                                                   <i class="icon-calendar"></i> {{\'APPLICATION_UPDATED_AT\' | translate}}: <strong>{{SmsRoom.updatedAt | date:\'medium\'}}</strong> (<span am-time-ago="SmsRoom.updatedAt"></span>)\n                                            </p>\n                                  </div>\n                                        <form name="forms.compose" data-ng-submit="forms.compose.$valid && sendSMS()" class="form-horizontal" novalidate>\n                                             <!-- START HEAD -->\n                                           <div class="form">\n\n                                                  <!-- START FROM -->\n                                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.compose.from.$invalid && forms.compose.$submitted}" data-ng-if="SmsRoom.status !== \'CLOSED\'">\n                                                                          <div class="col-md-12">\n                                                                                       <div class="row">\n                                                                                             <div class="col-md-1">\n                                                                                                        <label class="control-label">From:</label>\n                                                                                            </div>\n                                                                                                <div class="col-md-11">\n                                                                                                       <ui-select  data-ng-disabled="SmsRoom"  theme="bootstrap" name="from" data-ng-model="form.from" required>\n                                                                                                             <ui-select-match placeholder="From...">{{$select.selected.name}}</ui-select-match>\n                                                                                                            <ui-select-choices repeat="smsAccount.phone as smsAccount in smsAccounts | filter: $select.search">\n                                                                                                                   <div data-ng-bind-html="smsAccount.name | highlight: $select.search"></div>\n                                                                                                                   <small data-ng-bind-html="smsAccount.phone | highlight: $select.search"></small>\n                                                                                                              </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span data-ng-show="forms.compose.from.$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                                                                                </div>\n                                                                        </div>\n                                                                        <!-- END FROM -->\n                                                     <!-- START TO -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.compose.to.$invalid && forms.compose.$submitted}" data-ng-if="SmsRoom.status !== \'CLOSED\'">\n\n                                                          <div class="col-md-12">\n                                                                       <div class="row">\n                                                                             <div class="col-md-1">\n                                                                                        <label class="control-label">To:</label>\n                                                                              </div>\n                                                                                <div class="col-md-11">\n                                                                                       <input type="text" ng-pattern="/^[\\+]?[0-9]+$/"  name="to" class="form-control todo-taskbody-taskdesc" placeholder="To..." rows="8"   data-ng-disabled="SmsRoom" data-ng-model="form.to" required>\n                                                                                   <span data-ng-show="forms.compose.to.$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                                                                </div>\n                                                        </div>\n                                                        <!-- END TO -->\n                                                       <!-- START CANNED -->\n                                                 <div class="form-group"  data-ng-if="SmsRoom.status !== \'CLOSED\'">\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                                                                        </div>\n                                                                </div>\n\n                                                      </div>\n                                                        <!-- END CANNED -->\n                                                   <!-- START message -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.compose.body.$invalid && forms.compose.$submitted}" data-ng-if="SmsRoom.status !== \'CLOSED\'">\n                                                          <div class="col-md-12">\n                                                                       <textarea id="text" class="form-control maxlength-handler" rows="8" maxlength="160" name="body" data-ng-model="form.body" ></textarea>\n                                                                        <button id="btnPost" type="button" class="btn btn-success pull-right" ng-class="{\'btn-warning\': form.body.length >= 120, \'btn-danger\': form.body.length >= 141 }">{{ 160 - form.body.length }}</button>\n                                                                   <span class="help-block"> Max 160 chars</span>\n                                                                        <span data-ng-show="forms.compose.body.$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                                                      <!-- END message -->\n                                          </div>\n                                        </form>\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n<!-- END TODO CONTENT -->\n"),a.put("app/channels/sms/inbox/sms/info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body"  data-ng-init="initInfo()" style=" overflow-x: auto;">\n  <div class="form-group" ng-if="data">\n    <json-formatter json="data" open="1"></json-formatter>\n  </div>\n  <div class="note note-warning" data-ng-hide="data">\n    <p>\n      {{ \'MESSAGE_NO_INFO_AVAILABLE\' | translate }}\n    </p>\n  </div>\n\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/channels/sms/inbox/sms/sms.html",'<div class="message">\n  <div class="row">\n    <div class="col-md-6">\n      <span class="bold">From: </span>\n      [<a href="" data-ng-click="openContact(smsMessage.from)">{{smsMessage.from}}</a>]\n      <br>\n      <span class="bold">To: </span>\n      [<a href="" data-ng-click="openContact(smsMessage.to)">{{smsMessage.to}}</a>]\n      <br>\n    </div>\n    <div class="col-md-6">\n      <span class="pull-right" data-ng-if="smsMessage.User">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>{{smsMessage.User.fullname}}</strong></span>\n      <span class="pull-right" data-ng-if="smsMessage.source">{{\'APPLICATION_SENT_BY\' | translate}}: <strong>Cally &#178;</strong>\n        <a ng-click="info(smsMessage.source)"><i class="icon-info font-blue"></i>\n        </a>\n    </div>\n  </div>\n\n  <br>\n  <span class="todo-tasklist-date">\n    <span class="pull-right" data-ng-switch="smsMessage.status">\n      <a ng-switch-when="RECEIVED" href="#" class="btn default btn-xs inactive-link green-stripe"> {{smsMessage.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="SENT" href="#" class="btn default btn-xs inactive-link green-stripe"> {{smsMessage.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="DELIVERED" href="#" class="btn default btn-xs inactive-link green-stripe"> {{smsMessage.status | uppercase}}\n        <i class="fa fa-check"></i>\n      </a>\n      <a ng-switch-when="SENDING" href="#" class="btn default btn-xs inactive-link blue-stripe" > {{smsMessage.status | uppercase}}\n        <i class="fa fa-warning"></i>\n      </a>\n      <a ng-switch-when="FAILED" href="#" class="btn default btn-xs red-stripe" data-ng-click="info(null,smsMessage.res_data)"> {{smsMessage.status | uppercase}}\n        <i class="fa fa-times"></i>\n      </a>\n      <a ng-switch-default href="#" class="btn default btn-xs"> {{smsMessage.status | uppercase}}\n      </a>\n      <br>\n      <!-- <a ng-href="https://www.twilio.com/docs/errors/{{smsMessage.errorcode}}" target="_blank" ng-if="(smsMessage.errorcode) && (accounttype==\'twilio\')">Error Code:{{smsMessage.errorcode}}</a>\n      <a ng-href="{{smsMessage.errorcode.length > 2 ? \'http://www.skebby.com/sms-api/sms-gateway/developers-docs/#receiveNotifySection\' : \'http://www.skebby.com/sms-api/sms-gateway/developers-docs/#errorCodesSection\'}}" target="_blank" ng-if="(smsMessage.errorcode != 1) && (smsMessage.errorcode) && (accounttype==\'skebby\')">Error Code:{{smsMessage.errorcode}}</a> -->\n    </span>\n\n    <i class="icon-calendar"></i> <span am-time-ago="smsMessage.updatedAt"></span>\n  </span>\n  <hr>\n  <span class="body text-left" data-ng-bind-html="smsMessage.body" style="white-space: pre-wrap;"></span>\n\n  </div>\n'),a.put("app/channels/sms/inbox/view/account/list/list.html",'<!-- BEGIN Portlet PORTLET-->\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="\'NEW\'" uib-uncheckable>NEW</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="\'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="\'PENDING\'" uib-uncheckable>PENDING</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                  <a href="#" class="btn btn-icon-only red" data-ng-click="deleteItems();" data-ng-show="id.length && isAdmin">\n                         <i class="fa fa-trash"></i>\n                   </a>\n                  <a href="#" class="btn btn-icon-only btn-success" data-ng-click="disposeItems();" data-ng-show="id.length">\n                           <i class="fa fa-upload"></i>\n                  </a>\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 green" data-ng-click="openRoom(null, \'New Message\')">\n                          <i class="fa fa-plus"></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="false"></span>\n              <!-- END UI-GRID SPINNER -->\n\n                <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-pagination ui-grid-selection ui-grid-exporter 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'),a.put("app/channels/sms/inbox/view/view.agents.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_AGENTS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TRANSPORT -->\n  <div class="form-group">\n    <form name="form" novalidate>\n      <!-- START TRANSPORT -->\n      <div class="form-group">\n        <ui-select multiple name="agents" data-ng-model="item.agents" theme="bootstrap">\n          <ui-select-match placeholder="{{\'APPLICATION_AGENTS\' | translate}}">{{$item.fullname}}</ui-select-match>\n          <ui-select-choices repeat="agent.id as agent in agents | filter: $select.search">\n            {{agent.fullname}}\n          </ui-select-choices>\n        </ui-select>\n      </div>\n      <!-- END TRANSPORT -->\n    </form>\n  </div>\n  <!-- END TRANSPORT -->\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" data-ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/channels/sms/inbox/view/view.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="glyphicon glyphicon-comment"></i>\n          <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n          <i class="fa fa-angle-right"></i>\n        </li>\n        <li>\n                                   <i class="icon-note"></i>\n                                     <a href="/channels/sms/inbox/list">{{ \'APPLICATION_INBOX\' | translate }}</a>\n                                </li>\n      </ul>\n    </div>\n  </div>\n</div>\n\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row inbox" data-ng-init="initView()">\n   <div class="col-md-3">\n                <ul class="inbox-nav margin-bottom-10">\n                       <li data-ng-class="{active: $stateParams.id == smsAccount.id}" data-ng-repeat="smsAccount in smsAccounts">\n                            <a href="/channels/sms/inbox/view/account/{{smsAccount.id}}/list" class="btn">\n                                        <i class="icon-notebook"></i> {{smsAccount.name}}\n                             </a>\n        <b></b>\n                 </li>\n         </ul>\n </div>\n\n      <div class="col-md-9" >\n               <!-- BEGIN PROFILE CONTENT -->\n                <div ui-view>\n                 <div class="note note-info">\n                          <h4 class="block">Info! {{\'APPLICATION_NO_ACCOUNT_SELECTED\' | translate}}</h4>\n                      </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/sms/inbox/view/view.status.modal.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/sms/inbox/view/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'),a.put("app/channels/sms/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.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/sms/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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in strategies | 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" min="0" 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/sms/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="glyphicon glyphicon-comment"></i>\n                                           <a href="#">{{ \'APPLICATION_SMS\' | 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                                        <div class="btn-group">\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>\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/sms/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/sms/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-puzzle"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/sms/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.channels -->\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 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.channels.sms.queues.view.settings\')}">\n                                          <a data-ng-href="/channels/sms/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.sms.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/sms/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.channels -->\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/sms/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 && updateSmsQueue()" 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 strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | 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">Timeout</label>\n                                          <input type="number" name="timeout" placeholder="Timeout" 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/sms/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/sms/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/sms/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/sms/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/sms/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | 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.sms.realtime.view.agents\')}">\n                                                      <a href="/channels/sms/realtime/view/agents">\n                                                         {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.sms.realtime.view.applications\')}">\n                                                        <a href="/channels/sms/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/sms/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n        <div class="col-md-12">\n               <!-- START TABLE -->\n          <div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="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 PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CHANSPY\' | 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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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 PREFIX -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.prefix.$touched || form.$submitted) && form.prefix.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="item.prefix" required/>\n      <span data-ng-show="(form.prefix.$touched || form.$submitted) && form.prefix.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PREFIX -->\n\n    <!-- START OPTIONS -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.options.$touched || form.$submitted) && form.options.$invalid}">\n      <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select multiple data-ng-model="item.options" name="options" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n        <ui-select-choices repeat="option.value as option in options | filter: $select.search">\n          <div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.options.$touched || form.$submitted) && form.options.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END OPTIONS -->\n\n    <!-- START AUTH -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="item.auth"\n      type="checkbox"\n      name="auth"\n      data-ng-init="item.auth = 0"\n      switch-active="{{ recordSwitch.isActive }}"\n      switch-on-text="{{ recordSwitch.onText }}"\n      switch-off-text="{{ recordSwitch.offText }}"\n      switch-on-color="{{ recordSwitch.onColor }}"\n      switch-off-color="{{ recordSwitch.offColor }}"\n      switch-animate="{{ recordSwitch.animate }}"\n      switch-size="{{ recordSwitch.size }}"\n      switch-label="{{ recordSwitch.label }}"\n      switch-icon="{{ recordSwitch.icon }}"\n      switch-radio-off="{{ recordSwitch.radioOff }}"\n      switch-label-width="{{ recordSwitch.labelWidth }}"\n      switch-handle-width="{{ recordSwitch.handleWidth }}">\n    </div>\n    <!-- END AUTH -->\n\n    <!-- START PASSWORD -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span data-ng-show="item.auth" class="required" aria-required="true">*</span></label>\n      <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" data-ng-disabled="!item.auth" data-ng-required="item.auth"/>\n      <span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PASSWORD -->\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="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/voice/chanspy/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-magnifier"></i>\n                                        <a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | 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-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_CHANSPY\' | 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="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CHANSPY\' | translate }}\n                                               </button>\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/voice/chanspy/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getChanSpy()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-eye"></i>\n                                      <a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n                                 <i data-ng-show="chanspy" class="fa fa-angle-right"></i>\n                              </li>\n                         <li data-ng-show="chanspy">\n                                   <a href="#">{{chanspy.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/chanspy.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                                          {{chanspy.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.tools.chanspy.view.settings\')}">\n                                                        <a data-ng-href="/tools/chanspy/view/{{chanspy.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/channels/sms/inbox/view/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'),a.put("app/channels/sms/inbox/view/view.templates.modal.html",'<div class="modal-header" data-ng-init="initModal()">\n  <h3 class="modal-title">{{ \'APPLICATION_TEMPLATES\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="note note-info" data-ng-show="!templates.length">\n    <h4 class="block">Info!</h4>\n    <p>\n      {{\'MESSAGE_NO_TEMPLATES_AVAILABLE\' | translate}}\n    </p>\n  </div>\n  <form name="form" data-ng-show="templates.length" novalidate>\n    <div class="form-group">\n      <ui-select data-ng-model="item.template" theme="bootstrap">\n        <ui-select-match placeholder="Select a template in the list or search his name...">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="template in templates | propsFilter: {name: $select.search}">\n          <div ng-bind-html="template.name | highlight: $select.search"></div>\n          <small data-ng-show="template.description">\n            {{\'APPLICATION_DESCRIPTION\' | translate}}: {{template.description}}\n          </small>\n        </ui-select-choices>\n      </ui-select>\n    </div>\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="templates.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/sms/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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in strategies | 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" min="0" 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/sms/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="glyphicon glyphicon-comment"></i>\n                                           <a href="#">{{ \'APPLICATION_SMS\' | 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                                        <div class="btn-group">\n                                               <a class="btn green-jungle" href="#" data-ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_QUEUE\' | 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/sms/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4>\n                               <p>\n                                    {{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}\n                             </p>\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/sms/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-puzzle"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | translate }}</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/sms/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.channels -->\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 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.channels.sms.queues.view.settings\')}">\n                                          <a data-ng-href="/channels/sms/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.sms.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                    <a data-ng-href="/channels/sms/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.channels -->\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/sms/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 && updateSmsQueue()" 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 strategies | filter: $select.search">\n                                                          <div ng-bind-html="strategy | uppercase | 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">Timeout</label>\n                                          <input type="number" name="timeout" placeholder="Timeout" 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/sms/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/sms/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/sms/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/sms/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/sms/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="glyphicon glyphicon-comment"></i>\n                                   <a href="#">{{ \'APPLICATION_SMS\' | 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.sms.realtime.view.agents\')}">\n                                                      <a href="/channels/sms/realtime/view/agents">\n                                                         {{\'APPLICATION_AGENTS\' | translate}}\n                                                        </a>\n                                          </li>\n                                         <li data-ng-class="{\'active\': $state.is(\'main.channels.sms.realtime.view.applications\')}">\n                                                        <a href="/channels/sms/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/sms/realtime/view/view.queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAgents()">\n        <div class="col-md-12">\n               <!-- START TABLE -->\n          <div id="grid1" ui-grid="gridOptions"  ui-grid-resize-columns ui-grid-tree-view class="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 PAGE CONTENT-->\n'),a.put("app/channels/voice/chanspy/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CHANSPY\' | 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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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 PREFIX -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.prefix.$touched || form.$submitted) && form.prefix.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="item.prefix" required/>\n      <span data-ng-show="(form.prefix.$touched || form.$submitted) && form.prefix.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PREFIX -->\n\n    <!-- START OPTIONS -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.options.$touched || form.$submitted) && form.options.$invalid}">\n      <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <ui-select multiple data-ng-model="item.options" name="options" theme="bootstrap" required>\n        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n        <ui-select-choices repeat="option.value as option in options | filter: $select.search">\n          <div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(form.options.$touched || form.$submitted) && form.options.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END OPTIONS -->\n\n    <!-- START AUTH -->\n    <div class="form-group">\n      <label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n      <input\n      bs-switch\n      class="form-control"\n      ng-model="item.auth"\n      type="checkbox"\n      name="auth"\n      data-ng-init="item.auth = 0"\n      switch-active="{{ recordSwitch.isActive }}"\n      switch-on-text="{{ recordSwitch.onText }}"\n      switch-off-text="{{ recordSwitch.offText }}"\n      switch-on-color="{{ recordSwitch.onColor }}"\n      switch-off-color="{{ recordSwitch.offColor }}"\n      switch-animate="{{ recordSwitch.animate }}"\n      switch-size="{{ recordSwitch.size }}"\n      switch-label="{{ recordSwitch.label }}"\n      switch-icon="{{ recordSwitch.icon }}"\n      switch-radio-off="{{ recordSwitch.radioOff }}"\n      switch-label-width="{{ recordSwitch.labelWidth }}"\n      switch-handle-width="{{ recordSwitch.handleWidth }}">\n    </div>\n    <!-- END AUTH -->\n\n    <!-- START PASSWORD -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.password.$touched || form.$submitted) && form.password.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span data-ng-show="item.auth" class="required" aria-required="true">*</span></label>\n      <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="item.password" data-ng-disabled="!item.auth" data-ng-required="item.auth"/>\n      <span data-ng-show="(form.password.$touched || form.$submitted) && form.password.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PASSWORD -->\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="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/voice/chanspy/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-magnifier"></i>\n                                        <a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | 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-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_CHANSPY\' | 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="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CHANSPY\' | translate }}\n                                               </button>\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/voice/chanspy/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getChanSpy()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-eye"></i>\n                                      <a href="/channels/voice/chanspys/list">{{ \'APPLICATION_CHANSPY\' | translate }}</a>\n                                 <i data-ng-show="chanspy" class="fa fa-angle-right"></i>\n                              </li>\n                         <li data-ng-show="chanspy">\n                                   <a href="#">{{chanspy.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/chanspy.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                                          {{chanspy.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.tools.chanspy.view.settings\')}">\n                                                        <a data-ng-href="/tools/chanspy/view/{{chanspy.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/channels/voice/chanspy/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_CHANSPY\' | 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 && updateChanSpy()" 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="chanspy.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 PREFIX -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_PREFIX\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <input type="text" name="prefix" placeholder="{{\'APPLICATION_PREFIX\' | translate}}" class="form-control" data-ng-model="chanspy.prefix" required/>\n                                                          <span data-ng-show="(form.general.prefix.$touched || form.general.$submitted) && form.general.prefix.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PREFIX -->\n\n                                                 <!-- START OPTIONS -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (form.general.options.$touched || form.general.$submitted) && form.general.options.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select multiple data-ng-model="chanspy.options" name="options" theme="bootstrap" required>\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.value}}: {{$item.name | translate}}</ui-select-match>\n                                                                    <ui-select-choices repeat="option.value as option in options | filter: $select.search">\n                                                                               <div ng-bind-html="option.value + \': \' + (option.name | translate) | highlight: $select.search"></div>\n                                                                      </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(form.general.options.$touched || form.general.$submitted) && form.general.options.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END OPTIONS -->\n\n                                                        <!-- START AUTH -->\n                                                   <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_AUTH\' | translate}}</label></br>\n                                                                <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="chanspy.auth"\n                                                               type="checkbox"\n                                                               name="auth"\n                                                           switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                 </div>\n                                                        <!-- END AUTH -->\n\n                                                   <!-- START PASSWORD -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (form.general.password.$touched || form.general.$submitted) && form.general.password.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}<span class="required" data-ng-show="chanspy.auth" aria-required="true">*</span></label>\n                                                         <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="chanspy.password" data-ng-disabled="!chanspy.auth" data-ng-required="chanspy.auth"/>\n                                                                <span data-ng-show="(form.general.password.$touched || form.general.$submitted) && form.general.password.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\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="chanspy.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/channels/voice/context/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONTEXT\' | 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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-disabled="form.$invalid">{{ \'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/voice/context/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="#">{{ \'APPLICATION_CONTEXTS\' | 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-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_CONTEXTS\' | 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()">\n                                            <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTEXT\' | 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/voice/context/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getContext()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/voice/contexts/list">{{ \'APPLICATION_CONTEXTS\' | translate }}</a>\n                                        <i data-ng-show="context" class="fa fa-angle-right"></i>\n                              </li>\n                         <li data-ng-show="context">\n                                   <a href="#">{{context.name}}</a>\n                              </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET main.channels -->\n                        <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/context.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                                          {{context.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.voice.contexts.view.settings\')}">\n                                                      <a data-ng-href="/channels/voice/contexts/view/{{context.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.channels -->\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/voice/context/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_CONTEXT\' | 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 && updateVoiceContext()" 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="context.name" required readonly/>\n                                                               <span class="help-block">\n                                                                     {{ \'DESCRIPTION_CANT_EDIT_NAME\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(form.name.$touched || form.$submitted) && form.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="context.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/channels/voice/disposition/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-wrench"></i>\n                                   <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-target"></i>\n                                   <a href="/channels/voice/dispositions/list">{{ \'APPLICATION_DISPOSITIONS\' | 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-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</a> </span>\n                              </div>\n                                <div class="actions">\n                                 <a href="#" class="btn btn-icon-only green" data-ng-click="addDisposition();">\n                                                <i class="fa fa-plus"></i>\n                                    </a>\n                          </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <div class="row" data-ng-hide="dispositions.length">\n                                          <div class="col-md-12">\n                                                       <div class="note note-info">\n                                                          <h4 class="block">Info! {{\'MESSAGE_NO_DISPOSITIONS_AVAILABLE\' | translate}}</h4>\n                                                    </div>\n                                                </div>\n                                        </div>\n\n                                      <!-- GENERAL TAB -->\n                                  <div class="row" data-ng-repeat="disposition in dispositions">\n                                                <div class="col-md-12 form-group">\n                                                    <div class="input-group">\n                                                             <div>\n                                                                 <input class="form-control" type="text" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" data-ng-model="disposition.name">\n                                                           </div>\n                                                                <span class="input-group-btn">\n                                                                        <button class="btn btn-success" type="button" data-ng-click="updateDisposition(disposition.id, disposition.name);"><i class="fa fa-cloud-upload fa-fw"></i> {{\'APPLICATION_UPDATE\' | translate}}</button>\n                                                                   <button class="btn btn-danger" type="button" data-ng-click="deleteDisposition(disposition.id);"><i class="fa fa-times fa-fw"></i> {{\'APPLICATION_DELETE\' | translate}}</button>\n                                                             </span>\n                                                       </div>\n                                                </div>\n                                        </div>\n                                        <!-- END GENERAL TAB -->\n                              </div>\n                        </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/disposition/list/modal/add.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_DISPOSITIONS\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n    <!-- START NAME -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.form.$touched || form.$submitted) && form.form.$invalid}">\n      <div class="">\n        <input type="text" name="form" placeholder="{{\'APPLICATION_DISPOSITION\' | translate}}" class="form-control" data-ng-model="name" required/>\n        <span data-ng-show="form.form.$touched && form.form.$error.required" class="help-block help-block-error">\n          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n        </span>\n      </div>\n    </div>\n    <!-- END NAME -->\n  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" data-ng-click="ok()" data-ng-show="form.$valid">{{ \'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/voice/moh/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_MOH_CLASS\' | 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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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  </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="ok()" 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/voice/moh/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-music-tone"></i>\n                                       <a href="#">{{ \'APPLICATION_MOHS\' | 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-music-tone font-green-sharp"></i>\n                                      <span class="caption-subject">{{ \'APPLICATION_MOHS\' | 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                                               <a class="btn green-jungle" href="#" data-ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_MOH_CLASS\' | 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/voice/moh/view/view.addFiles.html",'\n<div class="row" data-ng-init="getSounds()">\n   <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_MOH\' | translate }} {{ \'APPLICATION_ADD_FILES\' | translate }}</a> </span>\n                           </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="note note-warning" data-ng-hide="soundList.length">\n                                       <h4 class="block">Warning!</h4>\n                                       <p>\n                                            {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n                                    </p>\n                                  <p>\n                                           {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n                                 </p>\n                          </div>\n            <form name="forms.general" data-ng-submit="(item.sounds.length > 0) && addMohs()" data-ng-show="soundList.length" novalidate>\n\n              <!-- START SOUNDS -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0}">\n                <label class="control-label">{{\'APPLICATION_SOUNDS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <ui-select multiple data-ng-model="item.sounds" theme="bootstrap" name="sounds" required>\n                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n                  <ui-select-choices repeat="sound.id as sound in soundList | filter: $select.search">\n                    {{sound.display_name}}\n                  </ui-select-choices>\n                </ui-select>\n                <span data-ng-show="(forms.general.sounds.$touched || forms.general.$submitted) && item.sounds.length == 0" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END OPTIONS -->\n\n                                                       <input type="submit" class="btn green-haze" value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </form>\n                       </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/moh/view/view.audios.html",'<div ui-view class="profile-content">\n<div class="row" data-ng-init="getAudioFiles()">\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_AUDIOS\' | translate}}</span>\n                          </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="audioFiles">\n                                             <a class="btn green-jungle " href="/channels/voice/mohs/view/{{moh.id}}/add" data-toggle="dropdown">\n                                                  <i class="icon-plus"></i> {{ \'APPLICATION_ADD_FILES\' | translate }}\n                                         </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="note note-warning" data-ng-hide="audioFiles">\n                                     <h4 class="block">Warning!</h4>\n                                       <p>\n                                            {{ \'MESSAGE_FOLDER_DOES_NOT_EXIST\' | translate }}\n                                  </p>\n                          </div>\n                                <!-- START TABLE -->\n                          <table class="table table-striped table-bordered table-hover" data-ng-show="audioFiles">\n                                        <thead>\n                                               <tr>\n                                                    <th>{{ \'APPLICATION_NAME\' | translate }}</th>\n                                                           <th width="30%">{{ \'APPLICATION_PREVIEW\' | translate }}</th>\n                                                                <th width="10%">{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n                                                  </tr>\n                                         </thead>\n                                      <tbody data-ng-model="audioFiles">\n                                      <tr data-ng-repeat="audiofile in audioFiles">\n                                                             <td>{{audiofile}}</td>\n                                                                <td>\n                                                                  <audio controls ng-src="{{getSecureSrc(audioSources[audiofile])}}" preload="none">\n                                        Your browser does not support the audio tag.\n                                        </audio></td>\n                                             <td>\n                                            <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(audiofile,audiofile)">\n                                                                             {{ \'APPLICATION_DELETE\' | translate }}\n                                              </a>\n                                        </td>\n                                       </tr>\n                                                     <tr data-ng-hide="audioFiles.length">\n                                                         <td colspan="3" style="text-align:center;">\n                                                                   <i>{{ \'MESSAGE_NO_AUDIOFILES_AVAILABLE\' | translate }}</i>\n                                                          </td>\n                                                 </tr>\n                                   </tbody>\n                            </table>\n                              <!-- END TABLE -->\n                    </div>\n                </div>\n        </div>\n</div>\n</div>\n'),a.put("app/channels/voice/moh/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getMoh()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-music-tone"></i>\n                                       <a href="/channels/voice/mohs/list">{{ \'APPLICATION_MOH_CLASS\' | translate }}</a>\n                                   <i data-ng-show="moh" class="fa fa-angle-right"></i>\n                          </li>\n                         <li data-ng-show="moh">\n                                       <a href="#">{{moh.name}}</a>\n                          </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar">\n                 <!-- PORTLET main.channels -->\n                        <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img data-ng-src="assets/images/media/moh.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                                          {{moh.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.voice.mohs.view.settings\')}">\n                                                  <a data-ng-href="/channels/voice/mohs/view/{{moh.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.voice.mohs.view.audios\') || $state.is(\'main.channels.voice.mohs.view.add\')}">\n                                                        <a data-ng-href="/channels/voice/mohs/view/{{moh.id}}/audios">\n                                                        <i class="icon-list"></i>\n                                                     {{ \'APPLICATION_AUDIOS\' | translate}} </a>\n                                          </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET main.channels -->\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/voice/moh/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_MOH_CLASS\' | 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" data-ng-init="getContexts();">\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 && updateVoiceMoh()" novalidate>\n\n                <!-- START PATH -->\n                   <div class="form-group" >\n               <label class="control-label">{{\'APPLICATION_PATH\' | translate}}</label>\n                     <input type="text" name="path" class="form-control" data-ng-model="moh.directory" disabled/>\n                </div>\n                <!-- END PATH -->\n\n                   <!-- START SORT -->\n                   <div class="form-group" data-ng-class="{\'has-error\': (forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$invalid}">\n                      <label class="control-label">{{\'APPLICATION_SORT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                 <ui-select data-ng-model="moh.sort" theme="bootstrap" name="sort" required>\n                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$translate.instant($select.selected.name)}}</ui-select-match>\n                  <ui-select-choices repeat="sort.value as sort in sortOptions | filter: $select.search">\n                         {{$translate.instant(sort.name)}}\n                   </ui-select-choices>\n                </ui-select>\n                  <span data-ng-show="(forms.general.sort.$touched || forms.general.$submitted) && forms.general.sort.$error.required" class="help-block help-block-error">\n                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n               </span>\n             </div>\n                <!-- END SORT -->\n\n                   <!-- START DESCRIPTION -->\n                                      <div class="form-group" data-ng-class="{\'has-error\': forms.general.$submitted && forms.general.description.$invalid}">\n                                        <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                      <textarea type="text" name="description" class="form-control" data-ng-model="moh.description"/></textarea>\n                                                            <span data-ng-show="forms.general.$submitted && forms.general.description.$invalid" class="help-block help-block-error">\n                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                       </span>\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                              </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
-a.put("app/channels/voice/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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.strategy.$touched || form.queue.$submitted) && form.queue.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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span class="help-block">\n        {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n      </span>\n      <span data-ng-show="(form.queue.strategy.$touched || form.queue.$submitted) && form.queue.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 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      <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="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/voice/queue/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | 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\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 }}</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/voice/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4><p>{{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}</p>\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/voice/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/voice/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.channels -->\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.voice.queues.view.settings\')}">\n                                                        <a data-ng-href="/channels/voice/queues/view/{{queue.name}}/settings"> <i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n                                           </li>\n                                         <li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                  <a data-ng-href="/channels/voice/queues/view/{{queue.name}}/agents"><i class="icon-people"></i>{{ \'APPLICATION_AGENTS\' | translate}} </a>\n                                           </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET main.channels -->\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/voice/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_QUEUE_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                                 <li>\n                                          <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</a>\n                                   </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n                                    </li>\n                         </ul>\n                 </div>\n\n                      <div class="portlet-body" data-ng-init="getContexts();getMohs();getSounds();">\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 && forms.announce.$valid && updateVoiceQueue()" novalidate>\n                                                   <div class="row">\n                                                             <div class="col-md-6">\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}}<span class="required" aria-required="true">*</span></label>\n                                                             <ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap" required>\n                                                                 <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n                                                                     <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n                                                                           <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.general.strategy.$touched || forms.general.$submitted) && forms.general.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 MOH -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_MOH\' | translate}}</label>\n                                                              <ui-select data-ng-model="queue.musiconhold" name="musiconhold" theme="bootstrap">\n                                                                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="musiconhold.name as musiconhold in voiceMohs | filter: $select.search">\n                                                                            <div ng-bind-html="musiconhold.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_VOICE_MOH\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MOH -->\n\n                                                    <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.timeout" required/>\n                                                               <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_TIMEOUT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.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 MAXLEN -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_MAXLEN\' | translate}}</label>\n                                                           <input type="number" min="0" name="maxlen" placeholder="{{\'APPLICATION_MAXLEN\' | translate}}" class="form-control" data-ng-model="queue.maxlen" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MAXLEN\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MAXLEN -->\n\n                                                 <!-- START RETRY -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_RETRY\' | translate}}</label>\n                                                            <input type="number" min="0" name="retry" placeholder="{{\'APPLICATION_RETRY\' | translate}}" class="form-control" data-ng-model="queue.retry" required/>\n                                                             <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RETRY\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RETRY -->\n\n                                          </div>\n                                                <div class="col-md-6">\n                                                        <!-- START WRAPUPTIME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_WRAPUPTIME\' | translate}}</label>\n                                                               <input type="number" min="0" name="wrapuptime" placeholder="{{\'APPLICATION_WRAPUPTIME\' | translate}}" class="form-control" data-ng-model="queue.wrapuptime" required/>\n                                                              <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_WRAPUPTIME\' | translate }}\n                                                            </span>\n                                                               <span data-ng-show="(forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END WRAPUPTIME -->\n\n                                                     <!-- START WEIGHT -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_WEIGHT\' | translate}}</label>\n                                                           <input type="number" min="0" name="weight" placeholder="{{\'APPLICATION_WEIGHT\' | translate}}" class="form-control" data-ng-model="queue.weight" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_WEIGHT\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END WEIGHT -->\n\n                                                 <!-- START JOINEMPTY -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_JOINEMPTY\' | translate}}</label>\n                                                                <ui-select multiple data-ng-model="queue.joinempty" name="joinempty" theme="bootstrap">\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n                                                                           <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_JOINEMPTY\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END JOINEMPTY -->\n\n                                                      <!-- START LEAVEWHENEMPTY -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_LEAVEWHENEMPTY\' | translate}}</label>\n                                                           <ui-select multiple data-ng-model="queue.leavewhenempty" name="leavewhenempty" theme="bootstrap">\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n                                                                           <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_LEAVEWHENEMPTY\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END LEAVEWHENEMPTY -->\n\n                                                 <!-- START ANNOUNCE -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <ui-select data-ng-model="queue.announce" name="announce" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in sounds | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$error.required" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE -->\n                                         </div>\n                                        </div>\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="queue.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\n                                      <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.announce" data-ng-submit="forms.announce.$valid && forms.general.$valid && updateVoiceQueue()" novalidate>\n                                                  <div class="row">\n                                                             <div class="col-md-12">\n                                                       <!-- START PERIODIC_ANNOUNCE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</label>\n                                                                <ui-select multiple data-ng-model="queue.periodic_announce" name="periodic_announce" theme="bootstrap" data-ng-disabled="!periodicAnnounces.length">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n                                                                 <ui-select-choices repeat="announce.path as announce in periodicAnnounces | filter: $select.search track by $index">\n                                                                          <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <div class="note note-warning" data-ng-hide="periodicAnnounces.length">\n                                                                       <h4 class="block">Warning!</h4>\n                                                                       <p>\n                                                                           {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n                                                                     </p>\n                                                                  <p>\n                                                                           {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n                                                                 </p>\n                                                          </div>\n                                                                <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PERIODIC_ANNOUNCE -->\n                                                </div>\n                                        </div>\n                                                        <div class="row">\n                                                             <div class="col-md-6">\n                                                        <p><h3>{{\'APPLICATION_SETTINGS\' | translate}}</h3></p>\n                                                      <!-- START ANNOUNCE_FREQUENCY -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                               <input type="number" min="0" name="announce_frequency" placeholder="{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.announce_frequency" required/>\n                                                              <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_FREQUENCY\' | translate }}\n                                                            </span>\n                                                               <span data-ng-show="(forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_FREQUENCY -->\n\n                                                     <!-- START MIN_ANNOUNCE_FREQUENCY -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                           <input type="number" min="0" name="min_announce_frequency" placeholder="{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.min_announce_frequency" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MIN_ANNOUNCE_FREQUENCY\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MIN_ANNOUNCE_FREQUENCY -->\n\n                                                 <!-- START PERIODIC_ANNOUNCE_FREQUENCY -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                              <input type="number" min="0" name="periodic_announce_frequency" placeholder="{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.periodic_announce_frequency"/>\n                                                            <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE_FREQUENCY\' | translate }}\n                                                           </span>\n                                                               <span data-ng-show="(forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PERIODIC_ANNOUNCE_FREQUENCY -->\n\n                                                    <!-- START RANDOM_PERIODIC_ANNOUNCE -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_RANDOM_PERIODIC_ANNOUNCE\' | translate}}</label>\n                                                         <ui-select data-ng-model="queue.random_periodic_announce" name="random_periodic_announce" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RANDOM_PERIODIC_ANNOUNCE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RANDOM_PERIODIC_ANNOUNCE -->\n\n                                                       <!-- START ANNOUNCE_HOLDTIME -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_ANNOUNCE_HOLDTIME\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.announce_holdtime" name="announce_holdtime" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'once\'] | filter: $select.search">\n                                                                               <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                                  </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_HOLDTIME\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_HOLDTIME -->\n\n                                                      <!-- START ANNOUNCE_POSITION -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.announce_position" name="announce_position" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'limit\',\'more\'] | filter: $select.search">\n                                                                             <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_POSITION -->\n\n                                                      <!-- START ANNOUNCE_POSITION_LIMIT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}</label>\n                                                          <input type="number" min="0" name="announce_position_limit" placeholder="{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}" class="form-control" data-ng-model="queue.announce_position_limit"/>\n                                                                <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION_LIMIT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_POSITION_LIMIT -->\n\n                                                        <!-- START REPORTHOLDTIME -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_REPORTHOLDTIME\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.reportholdtime" name="reportholdtime" theme="bootstrap">\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_REPORTHOLDTIME\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END REPORTHOLDTIME -->\n\n                                         </div>\n                                                        <div class="col-md-6">\n                                                                <p><h3>{{\'APPLICATION_SOUNDS\' | translate}}</h3></p>\n                                                                <!-- START QUEUE_REPORTHOLD -->\n                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_QUEUE_REPORTHOLD\' | translate}}</label>\n                                                                 <ui-select data-ng-model="queue.queue_reporthold" name="queue_reporthold" theme="bootstrap" >\n                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                                     <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span class="help-block">\n                                                                             {{ \'DESCRIPTION_QUEUE_REPORTHOLD\' | translate }}\n                                                                    </span>\n                                                                       <span data-ng-show="(forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE_REPORTHOLD -->\n\n                                                               <!-- START QUEUE_YOUARENEXT -->\n                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_QUEUE_YOUARENEXT\' | translate}}</label>\n                                                                 <ui-select data-ng-model="queue.queue_youarenext" name="queue_youarenext" theme="bootstrap" >\n                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                                     <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span class="help-block">\n                                                                             {{ \'DESCRIPTION_QUEUE_YOUARENEXT\' | translate }}\n                                                                    </span>\n                                                                       <span data-ng-show="(forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE_YOUARENEXT -->\n\n                                                       <!-- START QUEUE_THEREARE -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_THEREARE\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_thereare" name="queue_thereare" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_THEREARE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_THEREARE -->\n\n                                                 <!-- START QUEUE_CALLSWAITING -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_CALLSWAITING\' | translate}}</label>\n                                                               <ui-select data-ng-model="queue.queue_callswaiting" name="queue_callswaiting" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_CALLSWAITING\' | translate }}\n                                                          </span>\n                                                               <span data-ng-show="(forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_CALLSWAITING -->\n\n                                                     <!-- START QUEUE_HOLDTIME -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_HOLDTIME\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_holdtime" name="queue_holdtime" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_HOLDTIME\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_HOLDTIME -->\n\n                                                 <!-- START QUEUE_MINUTES -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_QUEUE_MINUTES\' | translate}}</label>\n                                                            <ui-select data-ng-model="queue.queue_minutes" name="queue_minutes" theme="bootstrap" >\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MINUTES\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_MINUTES -->\n\n                                                  <!-- START QUEUE_MINUTE -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_QUEUE_MINUTE\' | translate}}</label>\n                                                             <ui-select data-ng-model="queue.queue_minute" name="queue_minute" theme="bootstrap" >\n                                                                 <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MINUTE\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_MINUTE -->\n\n                                                   <!-- START QUEUE_SECONDS -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_QUEUE_SECONDS\' | translate}}</label>\n                                                            <ui-select data-ng-model="queue.queue_seconds" name="queue_seconds" theme="bootstrap" >\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_SECONDS\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_SECONDS -->\n\n                                                  <!-- START QUEUE_THANKYOU -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_THANKYOU\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_thankyou" name="QUEUE_THANKYOU" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_THANKYOU\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_THANKYOU -->\n\n                                         </div>\n                                        </div>\n\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                                      <!-- ADVANCED TAB -->\n                                 <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.advanced" data-ng-submit="forms.announce.$valid && forms.general.$valid && forms.advanced.$valid && updateVoiceQueue()" novalidate>\n\n                                                       <div class="row">\n                                                             <div class="col-md-6">\n\n                                                      <!-- START AUTOPAUSE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_AUTOPAUSE\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.autopause" name="autopause" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'all\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_AUTOPAUSE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END AUTOPAUSE -->\n\n                                                      <!-- START RINGINUSE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_RINGINUSE\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.ringinuse" name="ringinuse" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RINGINUSE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RINGINUSE -->\n\n                                                      <!-- START MEMBER_DELAY -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_MEMBER_DELAY\' | translate}}</label>\n                                                             <input type="number" min="0" name="memberdelay" placeholder="{{\'APPLICATION_MEMBER_DELAY\' | translate}}" class="form-control" data-ng-model="queue.memberdelay" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MEMBER_DELAY\' | translate }}\n                                                          </span>\n                                                               <span data-ng-show="(forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MEMBER_DELAY -->\n\n                                                   <!-- START ACW -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_ACW\' | translate}}</label></br>\n                                                         <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.acw"\n                                                          type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_ACW\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_ACW\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                             </span>\n                                                       </div>\n                                                        <!-- END ACW -->\n\n                                                    <!-- START SETINTERFACEVAR -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setinterfacevar.$touched || forms.advanced.$submitted) && forms.advanced.setinterfacevar.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SETINTERFACEVAR\' | translate}}</label></br>\n                                                             <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setinterfacevar"\n                                                              type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETINTERFACEVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.setinterfacevar.$touched || forms.advanced.$submitted) && forms.advanced.setinterfacevar.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_SETINTERFACEVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SETINTERFACEVAR -->\n\n                                                        <!-- START SETQUEUEVAR -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setqueuevar.$touched || forms.advanced.$submitted) && forms.advanced.setqueuevar.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SETQUEUEVAR\' | translate}}</label></br>\n                                                         <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setqueuevar"\n                                                          type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETQUEUEVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                            </span>\n                                                               <span data-ng-show="(forms.advanced.setqueuevar.$touched || forms.advanced.$submitted) && forms.advanced.setqueuevar.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_SETQUEUEVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                             </span>\n                                                       </div>\n                                                        <!-- END SETQUEUEVAR -->\n\n                                            </div>\n                                                        <div class="col-md-6">\n\n                                                      <!-- START TIMEOUTRESTART -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_TIMEOUTRESTART\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.timeoutrestart" name="timeoutrestart" theme="bootstrap">\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_TIMEOUTRESTART\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TIMEOUTRESTART -->\n\n                                                 <!-- START MONITOR_FORMAT -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_MONITOR_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <ui-select data-ng-model="queue.monitor_format" name="monitor_format" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="monFormat.value as monFormat in monitorFormats | filter: $select.search">\n                                                                          <div ng-bind-html="monFormat.name | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MONITOR_FORMAT\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MONITOR_FORMAT -->\n\n                                                 <!-- START CONTEXT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}</label>\n                                                          <ui-select data-ng-model="queue.context" name="context" theme="bootstrap">\n                                                                    <ui-select-match allow-clear placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                  <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n                                                                                <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_VOICE_CONTEXT\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONTEXT -->\n\n                                                        <!-- START ACW_TIMEOUT -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ACW_TIMEOUT\' | translate}}</label>\n                                                              <input type="number" min="0" name="acwTimeout" placeholder="{{\'APPLICATION_ACW_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.acwTimeout" required/>\n                                                             <span class="help-block">\n                                                                     {{ \'DESCRIPTION_ACW_TIMEOUT\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ACW_TIMEOUT -->\n\n                                                    <!-- START SETQUEUEENTRYVAR -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setqueueentryvar.$touched || forms.advanced.$submitted) && forms.advanced.setqueueentryvar.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_SETQUEUEENTRYVAR\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setqueueentryvar"\n                                                             type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETQUEUEENTRYVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                               </span>\n                                                               <span data-ng-show="(forms.advanced.setqueueentryvar.$touched || forms.advanced.$submitted) && forms.advanced.setqueueentryvar.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_SETQUEUEENTRYVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                </span>\n                                                       </div>\n                                                        <!-- END SETQUEUEENTRYVAR -->\n\n                                               </div>\n                                        </div>\n\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/channels/voice/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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.name.$touched || form.queue.$submitted) && form.queue.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.queue.strategy.$touched || form.queue.$submitted) && form.queue.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.toUpperCase()}}</ui-select-match>\n        <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n          <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span class="help-block">\n        {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n      </span>\n      <span data-ng-show="(form.queue.strategy.$touched || form.queue.$submitted) && form.queue.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 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      <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="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/voice/queue/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | 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\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 }}</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-show="Auth.getCurrentUser().role === \'admin\'">\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/voice/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="note note-warning" data-ng-hide="teams.length">\n                           <h4 class="block">Warning!</h4><p>{{ \'MESSAGE_NO_AVAILABLE_TEAMS\' | translate }}</p>\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/voice/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-docs"></i>\n                                     <a href="/channels/voice/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.channels -->\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.voice.queues.view.settings\')}">\n                                                        <a data-ng-href="/channels/voice/queues/view/{{queue.name}}/settings"> <i class="icon-settings"></i> {{ \'APPLICATION_SETTINGS\' | translate}} </a>\n                                           </li>\n                                         <li data-ng-class="{active: $state.is(\'main.channels.voice.queues.view.agents\')}" data-ng-show="Auth.getCurrentUser().role === \'admin\'">\n                                                  <a data-ng-href="/channels/voice/queues/view/{{queue.name}}/agents"><i class="icon-people"></i>{{ \'APPLICATION_AGENTS\' | translate}} </a>\n                                           </li>\n                                 </ul>\n                         </div>\n                                <!-- END MENU -->\n                     </div>\n                        <!-- END PORTLET main.channels -->\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/voice/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_QUEUE_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                                 <li>\n                                          <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</a>\n                                   </li>\n                                 <li>\n                                          <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_ADVANCED\' | translate}}</a>\n                                    </li>\n                         </ul>\n                 </div>\n\n                      <div class="portlet-body" data-ng-init="getContexts();getMohs();getSounds();">\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 && forms.announce.$valid && updateVoiceQueue()" novalidate>\n                                                   <div class="row">\n                                                             <div class="col-md-6">\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}}<span class="required" aria-required="true">*</span></label>\n                                                             <ui-select data-ng-model="queue.strategy" name="strategy" theme="bootstrap" required>\n                                                                 <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.toUpperCase()}}</ui-select-match>\n                                                                     <ui-select-choices repeat="strategy in [\'ringall\', \'leastrecent\', \'fewestcalls\', \'random\', \'rrmemory\', \'linear\', \'wrandom\', \'rrordered\'] | filter: $select.search">\n                                                                           <div ng-bind-html="strategy.toUpperCase() | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_STRATEGY\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.general.strategy.$touched || forms.general.$submitted) && forms.general.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 MOH -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_MOH\' | translate}}</label>\n                                                              <ui-select data-ng-model="queue.musiconhold" name="musiconhold" theme="bootstrap">\n                                                                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="musiconhold.name as musiconhold in voiceMohs | filter: $select.search">\n                                                                            <div ng-bind-html="musiconhold.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_VOICE_MOH\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.general.musiconhold.$touched || forms.general.$submitted) && forms.general.musiconhold.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MOH -->\n\n                                                    <!-- START TIMEOUT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.general.timeout.$touched || forms.general.$submitted) && forms.general.timeout.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_TIMEOUT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <input type="number" min="0" name="timeout" placeholder="{{\'APPLICATION_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.timeout" required/>\n                                                               <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_TIMEOUT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.general.timeout.$touched || forms.general.$submitted) && forms.general.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 MAXLEN -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_MAXLEN\' | translate}}</label>\n                                                           <input type="number" min="0" name="maxlen" placeholder="{{\'APPLICATION_MAXLEN\' | translate}}" class="form-control" data-ng-model="queue.maxlen" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MAXLEN\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.maxlen.$touched || forms.general.$submitted) && forms.general.maxlen.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MAXLEN -->\n\n                                                 <!-- START RETRY -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_RETRY\' | translate}}</label>\n                                                            <input type="number" min="0" name="retry" placeholder="{{\'APPLICATION_RETRY\' | translate}}" class="form-control" data-ng-model="queue.retry" required/>\n                                                             <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RETRY\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.general.retry.$touched || forms.general.$submitted) && forms.general.retry.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RETRY -->\n\n                                          </div>\n                                                <div class="col-md-6">\n                                                        <!-- START WRAPUPTIME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_WRAPUPTIME\' | translate}}</label>\n                                                               <input type="number" min="0" name="wrapuptime" placeholder="{{\'APPLICATION_WRAPUPTIME\' | translate}}" class="form-control" data-ng-model="queue.wrapuptime" required/>\n                                                              <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_WRAPUPTIME\' | translate }}\n                                                            </span>\n                                                               <span data-ng-show="(forms.general.wrapuptime.$touched || forms.general.$submitted) && forms.general.wrapuptime.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END WRAPUPTIME -->\n\n                                                     <!-- START WEIGHT -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_WEIGHT\' | translate}}</label>\n                                                           <input type="number" min="0" name="weight" placeholder="{{\'APPLICATION_WEIGHT\' | translate}}" class="form-control" data-ng-model="queue.weight" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_WEIGHT\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.weight.$touched || forms.general.$submitted) && forms.general.weight.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END WEIGHT -->\n\n                                                 <!-- START JOINEMPTY -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_JOINEMPTY\' | translate}}</label>\n                                                                <ui-select multiple data-ng-model="queue.joinempty" name="joinempty" theme="bootstrap">\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n                                                                           <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_JOINEMPTY\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.general.joinempty.$touched || forms.general.$submitted) && forms.general.joinempty.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END JOINEMPTY -->\n\n                                                      <!-- START LEAVEWHENEMPTY -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_LEAVEWHENEMPTY\' | translate}}</label>\n                                                           <ui-select multiple data-ng-model="queue.leavewhenempty" name="leavewhenempty" theme="bootstrap">\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'strict\',\'loose\',\'paused\',\'penalty\',\'inuse\',\'ringing\',\'unavailable\',\'invalid\',\'unknown\',\'wrapup\'] | filter: $select.search">\n                                                                           <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_LEAVEWHENEMPTY\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.general.leavewhenempty.$touched || forms.general.$submitted) && forms.general.leavewhenempty.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END LEAVEWHENEMPTY -->\n\n                                                 <!-- START ANNOUNCE -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_ANNOUNCE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                             <ui-select data-ng-model="queue.announce" name="announce" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in sounds | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.general.announce.$touched || forms.general.$submitted) && forms.general.announce.$error.required" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE -->\n                                         </div>\n                                        </div>\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="queue.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\n                                      <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.announce" data-ng-submit="forms.announce.$valid && forms.general.$valid && updateVoiceQueue()" novalidate>\n                                                  <div class="row">\n                                                             <div class="col-md-12">\n                                                       <!-- START PERIODIC_ANNOUNCE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE\' | translate}}</label>\n                                                                <ui-select multiple data-ng-model="queue.periodic_announce" name="periodic_announce" theme="bootstrap" data-ng-disabled="!periodicAnnounces.length">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$item.display_name}}</ui-select-match>\n                                                                 <ui-select-choices repeat="announce.path as announce in periodicAnnounces | filter: $select.search track by $index">\n                                                                          <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <div class="note note-warning" data-ng-hide="periodicAnnounces.length">\n                                                                       <h4 class="block">Warning!</h4>\n                                                                       <p>\n                                                                           {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n                                                                     </p>\n                                                                  <p>\n                                                                           {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n                                                                 </p>\n                                                          </div>\n                                                                <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.periodic_announce.$touched || forms.announce.$submitted) && forms.announce.periodic_announce.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PERIODIC_ANNOUNCE -->\n                                                </div>\n                                        </div>\n                                                        <div class="row">\n                                                             <div class="col-md-6">\n                                                        <p><h3>{{\'APPLICATION_SETTINGS\' | translate}}</h3></p>\n                                                      <!-- START ANNOUNCE_FREQUENCY -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                               <input type="number" min="0" name="announce_frequency" placeholder="{{\'APPLICATION_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.announce_frequency" required/>\n                                                              <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_FREQUENCY\' | translate }}\n                                                            </span>\n                                                               <span data-ng-show="(forms.announce.announce_frequency.$touched || forms.announce.$submitted) && forms.announce.announce_frequency.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_FREQUENCY -->\n\n                                                     <!-- START MIN_ANNOUNCE_FREQUENCY -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                           <input type="number" min="0" name="min_announce_frequency" placeholder="{{\'APPLICATION_MIN_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.min_announce_frequency" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MIN_ANNOUNCE_FREQUENCY\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.min_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.min_announce_frequency.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MIN_ANNOUNCE_FREQUENCY -->\n\n                                                 <!-- START PERIODIC_ANNOUNCE_FREQUENCY -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}</label>\n                                                              <input type="number" min="0" name="periodic_announce_frequency" placeholder="{{\'APPLICATION_PERIODIC_ANNOUNCE_FREQUENCY\' | translate}}" class="form-control" data-ng-model="queue.periodic_announce_frequency"/>\n                                                            <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_PERIODIC_ANNOUNCE_FREQUENCY\' | translate }}\n                                                           </span>\n                                                               <span data-ng-show="(forms.announce.periodic_announce_frequency.$touched || forms.announce.$submitted) && forms.announce.periodic_announce_frequency.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PERIODIC_ANNOUNCE_FREQUENCY -->\n\n                                                    <!-- START RANDOM_PERIODIC_ANNOUNCE -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_RANDOM_PERIODIC_ANNOUNCE\' | translate}}</label>\n                                                         <ui-select data-ng-model="queue.random_periodic_announce" name="random_periodic_announce" theme="bootstrap">\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RANDOM_PERIODIC_ANNOUNCE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.random_periodic_announce.$touched || forms.announce.$submitted) && forms.announce.random_periodic_announce.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RANDOM_PERIODIC_ANNOUNCE -->\n\n                                                       <!-- START ANNOUNCE_HOLDTIME -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_ANNOUNCE_HOLDTIME\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.announce_holdtime" name="announce_holdtime" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'once\'] | filter: $select.search">\n                                                                               <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                                  </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_HOLDTIME\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.announce_holdtime.$touched || forms.announce.$submitted) && forms.announce.announce_holdtime.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_HOLDTIME -->\n\n                                                      <!-- START ANNOUNCE_POSITION -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.announce_position" name="announce_position" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'limit\',\'more\'] | filter: $select.search">\n                                                                             <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.announce.announce_position.$touched || forms.announce.$submitted) && forms.announce.announce_position.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_POSITION -->\n\n                                                      <!-- START ANNOUNCE_POSITION_LIMIT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}</label>\n                                                          <input type="number" min="0" name="announce_position_limit" placeholder="{{\'APPLICATION_ANNOUNCE_POSITION_LIMIT\' | translate}}" class="form-control" data-ng-model="queue.announce_position_limit"/>\n                                                                <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_ANNOUNCE_POSITION_LIMIT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.announce_position_limit.$touched || forms.announce.$submitted) && forms.announce.announce_position_limit.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ANNOUNCE_POSITION_LIMIT -->\n\n                                                        <!-- START REPORTHOLDTIME -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_REPORTHOLDTIME\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.reportholdtime" name="reportholdtime" theme="bootstrap">\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_REPORTHOLDTIME\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.reportholdtime.$touched || forms.announce.$submitted) && forms.announce.reportholdtime.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END REPORTHOLDTIME -->\n\n                                         </div>\n                                                        <div class="col-md-6">\n                                                                <p><h3>{{\'APPLICATION_SOUNDS\' | translate}}</h3></p>\n                                                                <!-- START QUEUE_REPORTHOLD -->\n                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_QUEUE_REPORTHOLD\' | translate}}</label>\n                                                                 <ui-select data-ng-model="queue.queue_reporthold" name="queue_reporthold" theme="bootstrap" >\n                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                                     <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span class="help-block">\n                                                                             {{ \'DESCRIPTION_QUEUE_REPORTHOLD\' | translate }}\n                                                                    </span>\n                                                                       <span data-ng-show="(forms.announce.queue_reporthold.$touched || forms.announce.$submitted) && forms.announce.queue_reporthold.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE_REPORTHOLD -->\n\n                                                               <!-- START QUEUE_YOUARENEXT -->\n                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$invalid}">\n                                                                 <label class="control-label">{{\'APPLICATION_QUEUE_YOUARENEXT\' | translate}}</label>\n                                                                 <ui-select data-ng-model="queue.queue_youarenext" name="queue_youarenext" theme="bootstrap" >\n                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                                     <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span class="help-block">\n                                                                             {{ \'DESCRIPTION_QUEUE_YOUARENEXT\' | translate }}\n                                                                    </span>\n                                                                       <span data-ng-show="(forms.announce.queue_youarenext.$touched || forms.announce.$submitted) && forms.announce.queue_youarenext.$error.required" class="help-block help-block-error">\n                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END QUEUE_YOUARENEXT -->\n\n                                                       <!-- START QUEUE_THEREARE -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_THEREARE\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_thereare" name="queue_thereare" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_THEREARE\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_thereare.$touched || forms.announce.$submitted) && forms.announce.queue_thereare.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_THEREARE -->\n\n                                                 <!-- START QUEUE_CALLSWAITING -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_CALLSWAITING\' | translate}}</label>\n                                                               <ui-select data-ng-model="queue.queue_callswaiting" name="queue_callswaiting" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_CALLSWAITING\' | translate }}\n                                                          </span>\n                                                               <span data-ng-show="(forms.announce.queue_callswaiting.$touched || forms.announce.$submitted) && forms.announce.queue_callswaiting.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_CALLSWAITING -->\n\n                                                     <!-- START QUEUE_HOLDTIME -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_HOLDTIME\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_holdtime" name="queue_holdtime" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_HOLDTIME\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_holdtime.$touched || forms.announce.$submitted) && forms.announce.queue_holdtime.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_HOLDTIME -->\n\n                                                 <!-- START QUEUE_MINUTES -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_QUEUE_MINUTES\' | translate}}</label>\n                                                            <ui-select data-ng-model="queue.queue_minutes" name="queue_minutes" theme="bootstrap" >\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MINUTES\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.queue_minutes.$touched || forms.announce.$submitted) && forms.announce.queue_minutes.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_MINUTES -->\n\n                                                  <!-- START QUEUE_MINUTE -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_QUEUE_MINUTE\' | translate}}</label>\n                                                             <ui-select data-ng-model="queue.queue_minute" name="queue_minute" theme="bootstrap" >\n                                                                 <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MINUTE\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.announce.queue_minute.$touched || forms.announce.$submitted) && forms.announce.queue_minute.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_MINUTE -->\n\n                                                   <!-- START QUEUE_SECONDS -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_QUEUE_SECONDS\' | translate}}</label>\n                                                            <ui-select data-ng-model="queue.queue_seconds" name="queue_seconds" theme="bootstrap" >\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_SECONDS\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.announce.queue_seconds.$touched || forms.announce.$submitted) && forms.announce.queue_seconds.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_SECONDS -->\n\n                                                  <!-- START QUEUE_THANKYOU -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_QUEUE_THANKYOU\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.queue_thankyou" name="QUEUE_THANKYOU" theme="bootstrap" >\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="announce.path as announce in queueAnnounces | filter: $select.search">\n                                                                             <div ng-bind-html="announce.display_name | highlight: $select.search"></div>\n                                                                  </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_THANKYOU\' | translate }}\n                                                              </span>\n                                                               <span data-ng-show="(forms.announce.queue_thankyou.$touched || forms.announce.$submitted) && forms.announce.queue_thankyou.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END QUEUE_THANKYOU -->\n\n                                         </div>\n                                        </div>\n\n                                                      <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n                                      <!-- ADVANCED TAB -->\n                                 <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.advanced" data-ng-submit="forms.announce.$valid && forms.general.$valid && forms.advanced.$valid && updateVoiceQueue()" novalidate>\n\n                                                       <div class="row">\n                                                             <div class="col-md-6">\n\n                                                      <!-- START AUTOPAUSE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_AUTOPAUSE\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.autopause" name="autopause" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\',\'all\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_AUTOPAUSE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.advanced.autopause.$touched || forms.advanced.$submitted) && forms.advanced.autopause.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END AUTOPAUSE -->\n\n                                                      <!-- START RINGINUSE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$invalid}">\n                                                               <label class="control-label">{{\'APPLICATION_RINGINUSE\' | translate}}</label>\n                                                                <ui-select data-ng-model="queue.ringinuse" name="ringinuse" theme="bootstrap">\n                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_RINGINUSE\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.advanced.ringinuse.$touched || forms.advanced.$submitted) && forms.advanced.ringinuse.$error.required" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RINGINUSE -->\n\n                                                      <!-- START MEMBER_DELAY -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_MEMBER_DELAY\' | translate}}</label>\n                                                             <input type="number" min="0" name="memberdelay" placeholder="{{\'APPLICATION_MEMBER_DELAY\' | translate}}" class="form-control" data-ng-model="queue.memberdelay" required/>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MEMBER_DELAY\' | translate }}\n                                                          </span>\n                                                               <span data-ng-show="(forms.advanced.memberdelay.$touched || forms.advanced.$submitted) && forms.advanced.memberdelay.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MEMBER_DELAY -->\n\n                                                   <!-- START ACW -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_ACW\' | translate}}</label></br>\n                                                         <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.acw"\n                                                          type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_ACW\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.acw.$touched || forms.advanced.$submitted) && forms.advanced.acw.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_ACW\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                             </span>\n                                                       </div>\n                                                        <!-- END ACW -->\n\n                                                    <!-- START SETINTERFACEVAR -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setinterfacevar.$touched || forms.advanced.$submitted) && forms.advanced.setinterfacevar.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SETINTERFACEVAR\' | translate}}</label></br>\n                                                             <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setinterfacevar"\n                                                              type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETINTERFACEVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.setinterfacevar.$touched || forms.advanced.$submitted) && forms.advanced.setinterfacevar.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_SETINTERFACEVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END SETINTERFACEVAR -->\n\n                                                        <!-- START SETQUEUEVAR -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setqueuevar.$touched || forms.advanced.$submitted) && forms.advanced.setqueuevar.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_SETQUEUEVAR\' | translate}}</label></br>\n                                                         <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setqueuevar"\n                                                          type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETQUEUEVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                            </span>\n                                                               <span data-ng-show="(forms.advanced.setqueuevar.$touched || forms.advanced.$submitted) && forms.advanced.setqueuevar.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_SETQUEUEVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                             </span>\n                                                       </div>\n                                                        <!-- END SETQUEUEVAR -->\n\n                                            </div>\n                                                        <div class="col-md-6">\n\n                                                      <!-- START TIMEOUTRESTART -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_TIMEOUTRESTART\' | translate}}</label>\n                                                           <ui-select data-ng-model="queue.timeoutrestart" name="timeoutrestart" theme="bootstrap">\n                                                                      <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                      <ui-select-choices repeat="item in [\'yes\',\'no\'] | filter: $select.search">\n                                                                                <div ng-bind-html="item | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_TIMEOUTRESTART\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.timeoutrestart.$touched || forms.advanced.$submitted) && forms.advanced.timeoutrestart.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TIMEOUTRESTART -->\n\n                                                 <!-- START MONITOR_FORMAT -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_MONITOR_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <ui-select data-ng-model="queue.monitor_format" name="monitor_format" theme="bootstrap" required>\n                                                                     <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="monFormat.value as monFormat in monitorFormats | filter: $select.search">\n                                                                          <div ng-bind-html="monFormat.name | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_MONITOR_FORMAT\' | translate }}\n                                                                </span>\n                                                               <span data-ng-show="(forms.advanced.monitor_format.$touched || forms.advanced.$submitted) && forms.advanced.monitor_format.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END MONITOR_FORMAT -->\n\n                                                 <!-- START CONTEXT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}</label>\n                                                          <ui-select data-ng-model="queue.context" name="context" theme="bootstrap">\n                                                                    <ui-select-match allow-clear placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                  <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n                                                                                <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_QUEUE_VOICE_CONTEXT\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.context.$touched || forms.advanced.$submitted) && forms.advanced.context.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONTEXT -->\n\n                                                        <!-- START ACW_TIMEOUT -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_ACW_TIMEOUT\' | translate}}</label>\n                                                              <input type="number" min="0" name="acwTimeout" placeholder="{{\'APPLICATION_ACW_TIMEOUT\' | translate}}" class="form-control" data-ng-model="queue.acwTimeout" required/>\n                                                             <span class="help-block">\n                                                                     {{ \'DESCRIPTION_ACW_TIMEOUT\' | translate }}\n                                                         </span>\n                                                               <span data-ng-show="(forms.advanced.acwTimeout.$touched || forms.advanced.$submitted) && forms.advanced.acwTimeout.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END ACW_TIMEOUT -->\n\n                                                    <!-- START SETQUEUEENTRYVAR -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': (forms.advanced.setqueueentryvar.$touched || forms.advanced.$submitted) && forms.advanced.setqueueentryvar.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_SETQUEUEENTRYVAR\' | translate}}</label></br>\n                                                            <input\n                                                                bs-switch\n                                                             class="form-control"\n                                                          ng-model="queue.setqueueentryvar"\n                                                             type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                           switch-on-text="{{ recordSwitch.onText }}"\n                                                            switch-off-text="{{ recordSwitch.offText }}"\n                                                          switch-on-color="{{ recordSwitch.onColor }}"\n                                                          switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                           switch-size="{{ recordSwitch.size }}"\n                                                         switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                         switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                            switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                         <span class="help-block">\n                                                                     {{ \'DESCRIPTION_SETQUEUEENTRYVAR\' | translate }} <a href="https://wiki.xcallymotion.com/display/XMD/Queues+-+Voice+Channel" target="_blank">wiki</a>)\n                                                               </span>\n                                                               <span data-ng-show="(forms.advanced.setqueueentryvar.$touched || forms.advanced.$submitted) && forms.advanced.setqueueentryvar.$error.required" class="help-block help-block-error">\n                                                                  <strong>{{\'APPLICATION_SETQUEUEENTRYVAR\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                </span>\n                                                       </div>\n                                                        <!-- END SETQUEUEENTRYVAR -->\n\n                                               </div>\n                                        </div>\n\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/channels/voice/realtime/view/abandoned/abandoned.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initAbandoned()">\n      <div class="col-md-12">\n               <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-resize-columns  class="ui-grid" ui-grid-pagination 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/voice/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/voice/realtime/view/agent/agent.modal.info.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_SIP_CLIENT_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<!-- hidden random uiselect, needed to recompile the modal every time and show the content -->\n<ui-select multiple class="hide" 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.name 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<!--  -->\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/voice/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.name 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/voice/realtime/view/outbound/outbound.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initDials()">\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 ui-grid-pagination>\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/voice/realtime/view/parameter/parameter.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initParameters()">\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                  <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/voice/realtime/view/queue/queue.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\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                  <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/voice/realtime/view/queuecalls/queuecalls.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initQueues()">\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 ui-grid-pagination>\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/voice/realtime/view/telephone/telephone.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initTelephones()">\n <div class="col-md-12">\n               <!-- START TABLE -->\n          <div ui-grid="gridOptions" ui-grid-resize-columns  class="ui-grid" ui-grid-pagination 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/voice/realtime/view/telephone/telephone.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="telephone.ipaddr" class="well">\n  <div>{{telephone.ipaddr}}:{{telephone.port}}</div>\n  <div>{{telephone.fullcontact}}</div>\n  <div>{{telephone.useragent}}</div>\n  <div>{{telephone.lastms}}</div>\n</div>\n<div data-ng-if="!telephone.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/voice/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-directions"></i>\n                                       <a href="#">{{ \'APPLICATION_CHANNELS\' | translate }}</a>\n                                    <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-energy"></i>\n                                   <a href="/channels/voice/realtime/view/agents">{{ \'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.voice.realtime.view.agents\')}">\n                                                            <a href="/channels/voice/realtime/view/agents">\n                                                                       {{\'APPLICATION_AGENTS\' | translate}}\n                                                                </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.telephones\')}" data-ng-show="Auth.isAdmin()">\n                                                          <a href="/channels/voice/realtime/view/telephones">\n                                                                   {{\'APPLICATION_TELEPHONES\' | translate}}\n                                                            </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.queues\')}">\n                                                            <a href="/channels/voice/realtime/view/queues">\n                                                                       {{\'APPLICATION_QUEUES\' | translate}}\n                                                                </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.queuecalls\')}">\n                                                                <a href="/channels/voice/realtime/view/queuecalls">\n                                                                   {{\'APPLICATION_QUEUE_CALLS\' | translate}}\n                                                           </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.parameters\')}">\n                                                                <a href="/channels/voice/realtime/view/parameters">\n                                                                   {{\'APPLICATION_QUEUE_PARAMETERS\' | translate}}\n                                                              </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.abandoned\')}">\n                                                         <a href="/channels/voice/realtime/view/abandoned">\n                                                                    {{\'APPLICATION_QUEUE_ABANDONED\' | translate}}\n                                                               </a>\n                                                  </li>\n                                                 <li data-ng-class="{\'active\': $state.is(\'main.channels.voice.realtime.view.outbound\')}">\n                                                          <a href="/channels/voice/realtime/view/outbound">\n                                                                     {{\'APPLICATION_OUTBOUND_CALLS\' | translate}}\n                                                                </a>\n                                                  </li>\n                                         </ul>\n                                 </div>\n                    </nav>\n            </div>\n                <div ui-view></div>\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/recording/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="fa fa-play"></i>\n                                    <a href="#">{{ \'APPLICATION_RECORDINGS\' | 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-play font-green-sharp"></i>\n                                   <span class="caption-subject">{{ \'APPLICATION_RECORDINGS\' | 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                                       </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/voice/route/inbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\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.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/inbound/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-call-in"></i>\n                                  <a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | 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-users font-green-sharp"></i>\n                                   <span class="caption-subject">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | 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                                               <a class="btn green-jungle " href="#" data-ng-click="create()">\n                                                       <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | 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 class="ui-grid" ui-grid-draggable-rows>\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/voice/route/inbound/view/view.applications.html",'<div ui-view class="profile-content">\n<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_ACTIONS\' | translate}}</span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="selectedRows.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                                               <a class="btn green-jungle " href="/channels/voice/routes/inbound/view/{{route.id}}/application" data-toggle="dropdown">\n                                                      <i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n                                           </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div data-ng-if="showGrid" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-selection ui-grid-draggable-rows 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        </div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/inbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-reload"></i>\n                                   <a href="/channels/voice/routes/inbound/list">{{ \'APPLICATION_INBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n                                  <i data-ng-show="route" class="fa fa-angle-right"></i>\n                                </li>\n                         <li data-ng-show="route">\n                                     <a href="#">{{route.exten}}</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/inboundroute.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                                          {{route.exten}}\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.channels.voice.routes.inbound.view.settings\')}">\n                                                        <a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/inbound/view/\'+route.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.voice.routes.inbound.view.applications') || $state.is('main.channels.voice.routes.inbound.view.application') || $state.is('main.channels.voice.routes.inbound.view.applications.settings')}\">\n                                                  <a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/inbound/view/'+route.id+'/applications')\">\n                                                    <i class=\"icon-list\"></i>\n                                                   {{ 'APPLICATION_ACTIONS' | 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/voice/route/inbound/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_INBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | 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" data-ng-init="getContexts()">\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 && updateRoute()" novalidate>\n\n                                                       <!-- START EXTEN -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n                                                                <span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END EXTEN -->\n\n                                                  <!-- START CONTEXT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n                                                                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n                                                                                <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONTEXT -->\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="route.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                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/voice/route/internal/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\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.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/internal/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-reload"></i>\n                                   <a href="/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | 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-users font-green-sharp"></i>\n                                   <span class="caption-subject">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | 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                                               <a class="btn green-jungle " href="#" data-ng-click="create()">\n                                                       <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | 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 class="ui-grid" ui-grid-draggable-rows>\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/voice/route/internal/view/view.applications.html",'<div ui-view class="profile-content">\n<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_ACTIONS\' | translate}}</span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="selectedRows.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                                               <a class="btn green-jungle " href="/channels/voice/routes/internal/view/{{route.id}}/application" data-toggle="dropdown">\n                                                     <i class="icon-plus"></i> {{ \'APPLICATION_NEW_APPLICATION\' | translate }}\n                                           </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div data-ng-if="showGrid" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-selection ui-grid-draggable-rows 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        </div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/internal/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-reload"></i>\n                                   <a href="/channels/voice/routes/internal/list">{{ \'APPLICATION_INTERNAL\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n                                        <i data-ng-show="route" class="fa fa-angle-right"></i>\n                                </li>\n                         <li data-ng-show="route">\n                                     <a href="#">{{route.exten}}</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/internalroute.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                                          {{route.exten}}\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.channels.voice.routes.internal.view.settings\')}">\n                                                       <a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/internal/view/\'+route.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.voice.routes.internal.view.applications') || $state.is('main.channels.voice.routes.internal.view.application') || $state.is('main.channels.voice.routes.internal.view.applications.settings')}\">\n                                                       <a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/internal/view/'+route.id+'/applications')\">\n                                                   <i class=\"icon-list\"></i>\n                                                   {{ 'APPLICATION_ACTIONS' | 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                <!-- <pre>\n                    {{route | json}}\n              </pre> -->\n            <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n"),
 a.put("app/channels/voice/route/internal/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_INTERNAL\' | translate}} {{ \'APPLICATION_ROUTE\' | 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" data-ng-init="getContexts()">\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 && updateRoute()" novalidate>\n\n                                                       <!-- START EXTEN -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_PHONE_NUMBER\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="exten" placeholder="{{\'APPLICATION_PHONE_NUMBER\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n                                                                <span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END EXTEN -->\n\n                                                  <!-- START CONTEXT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n                                                                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n                                                                                <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONTEXT -->\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="route.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                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/voice/route/outbound/list/create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_ROUTE\' | translate }}</h3>\n</div>\n<div class="modal-body" data-ng-init="getTags()">\n  <form name="forms.extension" novalidate>\n\n    <!-- START EXTEN -->\n    <div class="form-group" data-ng-class="{\'has-error\': (forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$invalid || existRoute}">\n      <label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="item.exten" data-ng-pattern="settings.patternName" required/>\n      <span data-ng-show="(forms.extension.exten.$touched || forms.extension.$submitted) && forms.extension.exten.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END EXTEN -->\n\n    <!-- START TAG -->\n    <div class="form-group"  data-ng-class="{\'has-error\': (forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid}">\n      <label class="control-label">{{ \'APPLICATION_TAG\' | translate }}<span class="required" aria-required="true">*</span></label>\n      <ui-select data-ng-model="item.tag" name="tag" theme="bootstrap" required>\n        <ui-select-match placeholder="{{ \'APPLICATION_TAG\' | translate }}" data-ng-init="item.tag = \'--\'">{{$select.selected.name}}</ui-select-match>\n        <ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n          <div ng-bind-html="tag.name | highlight: $select.search"></div>\n        </ui-select-choices>\n      </ui-select>\n      <span data-ng-show="(forms.extension.tag.$touched || forms.extension.$submitted) && forms.extension.tag.$invalid && forms.extension.tag.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END TAG -->\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.extension.$invalid || existRoute">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n<!-- <pre>\n  {{item | json}}\n</pre> -->\n'),a.put("app/channels/voice/route/outbound/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-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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-call-out"></i>\n                                 <a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | 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-users font-green-sharp"></i>\n                                   <span class="caption-subject">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | 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                                               <a class="btn green-jungle " href="#" data-ng-click="create()">\n                                                       <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | 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 class="ui-grid" ui-grid-draggable-rows>\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/voice/route/outbound/view/view.html",'<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="getRoute()">\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-earphones-alt"></i>\n                                    <a href="#">{{ \'APPLICATION_VOICE\' | translate }}</a>\n                                       <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <i class="icon-call-out"></i>\n                                 <a href="/channels/voice/routes/outbound/list">{{ \'APPLICATION_OUTBOUND\' | translate }} {{ \'APPLICATION_ROUTES\' | translate }}</a>\n                                        <i data-ng-show="route" class="fa fa-angle-right"></i>\n                                </li>\n                         <li data-ng-show="route">\n                                     <a href="#">{{route.exten}}</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/outboundroute.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                                          {{route.exten}}\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.channels.voice.routes.outbound.view.settings\')}">\n                                                       <a data-ng-click="deselectAndRedirect(\'/channels/voice/routes/outbound/view/\'+route.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.voice.routes.outbound.view.routes') || $state.is('main.channels.voice.routes.outbound.view.route') || $state.is('main.channels.voice.routes.outbound.view.routes.settings')}\">\n                                                 <a data-ng-click=\"deselectAndRedirect('/channels/voice/routes/outbound/view/'+route.id+'/routes')\">\n                                                 <i class=\"icon-list\"></i>\n                                                   {{ 'APPLICATION_ACTIONS' | 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                <!-- <pre>\n                    {{route | json}}\n              </pre> -->\n            <!-- END PROFILE CONTENT -->\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n"),a.put("app/channels/voice/route/outbound/view/view.route.html",'<div class="row" data-ng-init="initApplication(true);getIntervals();">\n   <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_NEW_ROUTE\' | translate }} WIZARD</a> </span>\n                          </div>\n                        </div>\n                        <div class="portlet-body">\n                            <div class="profile-usertitle-name">\n                                  {{(main.app.name | translate) || \'Application\'}}\n                            </div>\n                                <wizard on-finish="addApplication()">\n         <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(forms.info.$valid)">\n                                                        <form name="forms.info" novalidate>\n                                                           <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                          <!-- START APP -->\n                                                            <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid}">\n                                                                      <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n                                                                            <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                          <ui-select-choices repeat="app in applications | filter: $select.search">\n                                                                                     <div ng-bind-html="app.name | translate | highlight: $select.search"></div>\n                                                                           </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.info.app.$touched || forms.info.$submitted) && forms.info.app.$invalid && forms.info.app.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END APP -->\n                                                              <div id="Dial" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && main.app.type == \'outboundDial\'" lazy-render duration="1">\n                                                         <!-- START TRUNK -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                              <ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n                                                                                    <div ng-bind-html="trunk.name | highlight: $select.search"></div>\n                                                                             </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                           <h4 class="block">Warning!</h4>\n                                                                               <p>\n                                                                                   {{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n                                                                             </p>\n                                                                          <p>\n                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n                                                                         </p>\n                                                                  </div>\n                                                                        <span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END TRUNK -->\n\n                                                          <!-- START CALLERID -->\n                                                               <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n                                                                    <label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n                                                                       <input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                         <span class="help-block">\n                                                                                     {{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }}\n                                                                           </span>\n                                                                       <span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END CALLERID -->\n\n                                                               <!-- START PREFIX -->\n                                                         <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n                                                                        <label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n                                                                 <input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                            <span class="help-block">\n                                                                                     {{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n                                                                             </span>\n                                                                               <span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n                                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END PREFIX -->\n\n                                                                 <!-- START TIMEOUT -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                           <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n                                                                           <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                           <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                                <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[4]" data-ng-init="application.appdata[4] = null">\n                                                                                <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END OPTIONS -->\n\n                                                                        <!-- START URL -->\n                                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                           <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                            <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[5]" data-ng-init="application.appdata[5] = null">\n                                                                           <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END URL -->\n\n                                                            </div>\n                                                        <div id="Custom" class="app-settings" ng-slide-down="main.app.type == \'custom\'" lazy-render duration="1">\n\n                                                         <!-- START CUSTOMAPP -->\n                                                              <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n                                                                  <label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                 <input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" data-ng-init="application.appdata[0] = null" required>\n                                                                    <span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END CUSTOMAPP -->\n\n                                                              <!-- START APPDATA -->\n                                                                <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n                                                                      <label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n                                                                      <input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[1] = null">\n                                                                 <span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END APPDATA -->\n                                                  </div>\n                                                        <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                  </form>\n                                                       </wz-step>\n                                                            <wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n                                                                       <form name="forms.interval" novalidate>\n                                                                               <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                                  <!-- START INTERVAL_TYPE -->\n                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n                                                                   <label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                        <ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n                                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                          <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                                       {{$translate.instant(intType.name)}}\n                                                                          </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVAL_TYPE -->\n                                                            <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n                                                                                <!-- START TIME -->\n                                                                           <div class="form-group">\n                                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                                   <div class="input-group input-large">\n                                                                                         <fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                                          <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                                <fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                                               <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label>\n                                                                                 </div>\n                                                                                </div>\n                                                                                <!-- END TIME -->\n\n                                                                           <!-- START WEEKDAY -->\n                                                                                <div class="form-group">\n                                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                                        <div class="input-group input-large">\n                                                                                         <ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n                                                                                                 <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                       <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                                {{weekDay.name | translate}}\n                                                                                                  </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                          <span class="input-group-addon">to</span>\n                                                                                             <ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n                                                                                                     <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                       <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                                {{weekDay.name | translate}}\n                                                                                                  </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                  </div>\n                                                                                </div>\n                                                                                <!-- END WEEKDAY -->\n\n                                                                                <!-- START MONTHDAY -->\n                                                                               <div class="form-group">\n                                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                                       <div class="input-group input-large">\n                                                                                         <ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n                                                                                                 <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                                        <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                                               {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                                   </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                          <span class="input-group-addon">to</span>\n                                                                                             <ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n                                                                                                     <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                                        <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                                               {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                                   </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                  </div>\n                                                                                </div>\n                                                                                <!-- END MONTHDAY -->\n\n                                                                               <!-- START MONTH -->\n                                                                          <div class="form-group">\n                                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                                  <div class="input-group input-large">\n                                                                                         <ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n                                                                                                   <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                       <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                                {{month.name | translate}}\n                                                                                                    </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                          <span class="input-group-addon">to</span>\n                                                                                             <ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n                                                                                                       <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                       <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                                {{month.name | translate}}\n                                                                                                    </ui-select-choices>\n                                                                                          </ui-select>\n                                                                                  </div>\n                                                                                </div>\n                                                                                <!-- END MONTH -->\n                                            </div>\n\n                                              <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n                                                        <!-- START INTERVALS -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n                                                             <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                            <ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                  <ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n                                                                            {{interval.name | translate}}\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END INTERVALS -->\n\n                                              </div>\n\n                                              <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                  </form>\n                                               </wz-step>\n\n                                          <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                     <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/channels/voice/route/outbound/view/view.routeSettings.html",'<div class="row" data-ng-init="initApplication();getApplication();getIntervals();">\n      <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_APPLICATION_SETTINGS\' | translate }} WIZARD</a> </span>\n                               </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="updateRoute(\'routes\')">\n                                  <div class="profile-usertitle-name">\n                                          {{(main.app.name | translate) || \'Application\'}}\n                                    </div>\n                <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.info.$valid)">\n                                             <form name="forms.info" novalidate>\n                                                   <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                  <div id="Dial" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && main.app.type == \'outboundDial\'" lazy-render duration="1">\n\n                                                       <!-- START TRUNK -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_TRUNK\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                <ui-select data-ng-model="route.Applications[selectedApp].appdata[0]" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n                                                                            <div ng-bind-html="trunk.name | highlight: $select.search"></div>\n                                                                     </ui-select-choices>\n                                                          </ui-select>\n                                                          <div class="note note-warning" data-ng-hide="items.length">\n                                                                   <h4 class="block">Warning!</h4>\n                                                                       <p>\n                                                                           {{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n                                                                     </p>\n                                                                  <p>\n                                                                           {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/trunks/list">{{\'APPLICATION_TRUNKS\' | translate}}</a>\n                                                                 </p>\n                                                          </div>\n                                                                <span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TRUNK -->\n\n                                                  <!-- START CALLERID -->\n                                                       <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid}">\n                                                            <label class="control-label">{{ \'APPLICATION_CALLERID\' | translate }}</label>\n                                                               <input type="text" name="callerID" pattern=\'^"[a-zA-Z0-9_.-]*" <[a-zA-Z0-9_.-]*>\' placeholder=\'"name" <number>\' class="form-control" data-ng-model="route.Applications[selectedApp].appdata[1]">\n                                                                  <span class="help-block">\n                                                                             {{ \'DESCRIPTION_OUTBOUND_CALLERID\' | translate }} "name" &lt;number&gt;\n                                                                     </span>\n                                                               <span data-ng-show="(forms.info.callerID.$touched || forms.info.$submitted) && forms.info.callerID.$invalid" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CALLERID -->\n\n                                                       <!-- START PREFIX -->\n                                                 <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid}">\n                                                                <label class="control-label">{{ \'APPLICATION_PREFIX\' | translate }}</label>\n                                                         <input type="text" name="prefix"  placeholder="{{ \'APPLICATION_PREFIX\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[2]">\n                                                             <span class="help-block">\n                                                                     {{ \'DESCRIPTION_OUTBOUND_PREFIX\' | translate }}\n                                                             </span>\n                                                               <span data-ng-show="(forms.info.prefix.$touched || forms.info.$submitted) && forms.info.prefix.$invalid" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                                <!-- END PREFIX -->\n\n                                                         <!-- START TIMEOUT -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                   <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                        <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[3]">\n                                                                    <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                   <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                        <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[4]">\n                                                                 <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END OPTIONS -->\n\n                                                                <!-- START URL -->\n                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                   <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                    <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[5]">\n                                                                    <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END URL -->\n                                              </div>\n                                                <div id="Custom" class="app-settings" ng-slide-down="main.app.type == \'custom\'" lazy-render duration="1">\n\n                                                 <!-- START CUSTOMAPP -->\n                                                      <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid}">\n                                                          <label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                         <input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].app" required>\n                                                             <span data-ng-show="(forms.info.customApp.$touched || forms.info.$submitted) && forms.info.customApp.$invalid && forms.info.customApp.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CUSTOMAPP -->\n\n                                                      <!-- START APPDATA -->\n                                                        <div class="form-group"  data-ng-class="{\'has-error\': (forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid}">\n                                                              <label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n                                                              <input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="route.Applications[selectedApp].appdata[0]">\n                                                          <span data-ng-show="(forms.info.appdata.$touched || forms.info.$submitted) && forms.info.appdata.$invalid && forms.info.appdata.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END APPDATA -->\n                                          </div>\n                                                <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                  </form>\n                                       </wz-step>\n                                            <wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n                                                       <form name="forms.interval" novalidate>\n                                                               <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                          <!-- START INTERVAL_TYPE -->\n                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n                                                   <label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                        <ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n                                                                <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                          <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                       {{intType.name | translate}}\n                                                          </ui-select-choices>\n                                                  </ui-select>\n                                                  <span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                 </span>\n                                               </div>\n                                                <!-- END INTERVAL_TYPE -->\n                                            <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n                                                                <!-- START TIME -->\n                                                           <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                   <div class="input-group input-large">\n                                                                         <fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                          <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                <fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                       </div>\n                                                                </div>\n                                                                <!-- END TIME -->\n\n                                                           <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                <!-- START ALWAYS -->\n                                                         <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                 <div class="input-group input-large">\n                                                                         <label class="control-label pointer-cursor">\n                                                                                  <input\n                                                                                                bs-switch\n                                                                                             data-ng-model="interval.alwaysTime"\n                                                                                           type="checkbox"\n                                                                                               switch-active="{{ alwaysSwitch.isActive }}"\n                                                                                           switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                switch-on-color="{{ alwaysSwitch.onColor }}"\n                                                                                          switch-off-color="{{ alwaysSwitch.offColor }}"\n                                                                                                switch-animate="{{ alwaysSwitch.animate }}"\n                                                                                           switch-size="{{ alwaysSwitch.size }}"\n                                                                                         switch-label="{{ alwaysSwitch.label }}"\n                                                                                               switch-icon="{{ alwaysSwitch.icon }}"\n                                                                                         switch-radio-off="{{ alwaysSwitch.radioOff }}"\n                                                                                                switch-label-width="{{ alwaysSwitch.labelWidth }}"\n                                                                                            switch-handle-width="{{ alwaysSwitch.handleWidth }}">\n                                                                         </label>\n                                                                      </div>\n                                                                </div>\n                                                                <!-- END ALWAYS -->\n\n                                                         <!-- START WEEKDAY -->\n                                                                <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                        <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n                                                                                 <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{weekDay.name | translate}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n                                                                                     <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                {{weekDay.name | translate}}\n                                                                                  </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END WEEKDAY -->\n\n                                                                <!-- START MONTHDAY -->\n                                                               <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                       <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n                                                                                 <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                        <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                   </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n                                                                                     <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                        <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                               {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                   </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTHDAY -->\n\n                                                               <!-- START MONTH -->\n                                                          <div class="form-group">\n                                                                      <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                  <div class="input-group input-large">\n                                                                         <ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n                                                                                   <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{month.name | translate}}\n                                                                                    </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span class="input-group-addon">to</span>\n                                                                             <ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n                                                                                       <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                       <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                {{month.name | translate}}\n                                                                                    </ui-select-choices>\n                                                                          </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n                                                                <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                          <ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n                                                                                    {{interval.name | translate}}\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                         </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n                                                        <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                     <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                  </form>\n                                               </wz-step>\n\n                                          <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                     <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/channels/voice/route/outbound/view/view.routes.html",'<div ui-view class="profile-content">\n<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_ACTIONS\' | translate}}</span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="selectedRows.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                                               <a class="btn green-jungle " href="/channels/voice/routes/outbound/view/{{route.id}}/route" data-toggle="dropdown">\n                                                   <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ROUTE\' | translate }}\n                                         </a>\n                                  </div>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <div data-ng-if="showGrid" ui-grid="gridOptions"  ui-grid-resize-columns class="grid" ui-grid-selection ui-grid-draggable-rows 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        </div>\n</div>\n</div>\n'),a.put("app/channels/voice/route/outbound/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_OUTBOUND\' | translate}} {{ \'APPLICATION_ROUTE\' | 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" data-ng-init="getContexts();getTags();">\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 && updateRoute()" novalidate>\n\n                                                       <!-- START EXTEN -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$invalid}">\n                                                          <label class="control-label">{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                          <input type="text" name="exten" placeholder="{{\'APPLICATION_DESTINATION_PATTERN\' | translate}}" class="form-control" data-ng-model="route.exten" required/>\n                                                         <span data-ng-show="(forms.general.exten.$touched || forms.general.$submitted) && forms.general.exten.$error.required" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END EXTEN -->\n\n                                                  <!-- START CUTDIGITS -->\n                                                      <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_CUTDIGITS\' | translate}}</label>\n                                                                <input type="text" pattern="[0-9]+" class="form-control" name="cutdigits" data-ng-model="route.cutdigits">\n                                                            <span class="help-block">\n                                                             </span>\n                                                       </div>\n                                                        <!-- END CUTDIGITS -->\n\n                                                      <!-- START TAG -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_TAG\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                          <ui-select data-ng-model="route.tag" name="tag" theme="bootstrap" required>\n                                                                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="tag.name as tag in tags | filter: $select.search">\n                                                                         <div ng-bind-html="tag.name | highlight: $select.search"></div>\n                                                                       </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.general.tag.$touched || forms.general.$submitted) && forms.general.tag.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TAG -->\n\n                                                    <!-- START CONTEXT -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$invalid}">\n                                                              <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                              <ui-select data-ng-model="route.context" name="context" theme="bootstrap" required>\n                                                                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                      <ui-select-choices repeat="context.name as context in voiceContexts | filter: $select.search">\n                                                                                <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                   </ui-select-choices>\n                                                          </ui-select>\n                                                          <span class="help-block">\n                                                                     {{ \'DESCRIPTION_VOICE_CONTEXT\' | translate }}\n                                                               </span>\n                                                               <span data-ng-show="(forms.general.context.$touched || forms.general.$submitted) && forms.general.context.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONTEXT -->\n\n                                                        <!-- START RECORD -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': (forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_RECORDING\' | translate}}</label></br>\n                                                           <input\n                                                                    bs-switch\n                                                                         class="form-control"\n                                                              ng-model="route.record"\n                                                               type="checkbox"\n                                                               switch-active="{{ recordSwitch.isActive }}"\n                                                                   switch-on-text="{{ recordSwitch.onText }}"\n                                                                    switch-off-text="{{ recordSwitch.offText }}"\n                                                                  switch-on-color="{{ recordSwitch.onColor }}"\n                                                                  switch-off-color="{{ recordSwitch.offColor }}"\n                                                                switch-animate="{{ recordSwitch.animate }}"\n                                                                   switch-size="{{ recordSwitch.size }}"\n                                                                 switch-label="{{ recordSwitch.label }}"\n                                                               switch-icon="{{ recordSwitch.icon }}"\n                                                                 switch-radio-off="{{ recordSwitch.radioOff }}"\n                                                                switch-label-width="{{ recordSwitch.labelWidth }}"\n                                                                    switch-handle-width="{{ recordSwitch.handleWidth }}">\n                                                             <span data-ng-show="(forms.general.record.$touched || forms.general.$submitted) && forms.general.record.$error.required" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RECORD -->\n\n                                                 <!-- START RECORDINGFORMAT -->\n                                                        <div data-ng-if="route.record" class="form-group" data-ng-class="{\'has-error\': (forms.general.recordingFormat.$touched || forms.general.$submitted) && forms.general.recordingFormat.$invalid}">\n                                                            <label class="control-label">{{\'APPLICATION_FORMAT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                               <ui-select data-ng-model="route.recordingFormat" name="recordingFormat" theme="bootstrap" data-ng-required="route.record">\n                                                                    <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected}}</ui-select-match>\n                                                                   <ui-select-choices repeat="format in [\'wav\',\'gsm\'] | filter: $select.search">\n                                                                             <div ng-bind-html="format | highlight: $select.search"></div>\n                                                                 </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="(forms.general.recordingFormat.$touched || forms.general.$submitted) && forms.general.recordingFormat.$error.required" class="help-block help-block-error">\n                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END RECORDINGFORMAT -->\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="route.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                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/channels/voice/route/view.application.html",'\n<div class="row" data-ng-init="initApplication(true); getIntervals();">\n  <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_NEW_APPLICATION\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="addApplication()">\n                                 <div class="profile-usertitle-name">\n                                          {{(main.app.name | translate) || \'Application\'}}\n                                    </div>\n                <wz-step title="{{\'APPLICATION_APPLICATION\' | translate}}" canexit="formValidation(forms.settings.$valid)">\n                                                 <form name="forms.settings" novalidate>\n\n                                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                                  <!-- START APP -->\n                                                                    <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid}">\n                                                                          <label class="control-label">{{ \'APPLICATION_APPLICATION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                <ui-select data-ng-model="main.app" name="app" theme="bootstrap" required>\n                                                <ui-select-match placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}">{{$select.selected.name | translate}}</ui-select-match>\n                                                  <ui-select-choices repeat="app in $application.applications| filter: $select.search">\n                                                   <div ng-bind-html="app.name | translate | highlight: $select.search"></div>\n                                                 </ui-select-choices>\n                                                </ui-select>\n                                                                                <span data-ng-show="(forms.settings.app.$touched || forms.settings.$submitted) && forms.settings.app.$invalid && forms.settings.app.$error.required" class="help-block help-block-error">\n                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END APP -->\n\n                                                                    <div id="Queue" class="app-settings" ng-slide-down="main.app.value == \'Queue\'" lazy-render duration="1">\n                                                                            <!-- START QUEUE -->\n                                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$invalid}">\n                                                                                       <label class="control-label">{{\'APPLICATION_QUEUE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                        <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="queue" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="queue.name as queue in items | filter: $select.search">\n                                                                                                    <div ng-bind-html="queue.name | highlight: $select.search"></div>\n                                                                                             </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                                           <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_QUEUES_AVAILABLE\' | translate }}\n                                                                                             </p>\n                                                                                          <p>\n                                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/queues/list">{{\'APPLICATION_QUEUES\' | translate}}</a>\n                                                                                                </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.settings.queue.$touched || forms.settings.$submitted) && forms.settings.queue.$error.required" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END QUEUE -->\n\n                                                                          <!-- START OPTIONS -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n                                                                                  <input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                                       <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END OPTIONS -->\n                                                                          <!-- START URL -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                                    <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                                   <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END URL -->\n\n                                                                            <!-- START AUDIOFILE -->\n                                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n                                                                                       <label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}</label>\n                                                                                       <ui-select data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null" name="audiofile" theme="bootstrap" data-ng-disabled="!items2.length">\n                                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="soundPath+\'/\'+audio.save_name as audio in items2 | filter: $select.search">\n                                                                                                      <div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n                                                                                             </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items2.length">\n                                                                                          <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n                                                                                             </p>\n                                                                                          <p>\n                                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n                                                                                         </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END AUDIOFILE -->\n\n                                                                              <!-- START TIMEOUT -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                        <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[4]" data-ng-init="application.appdata[4] = null">\n                                                                                   <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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                                                                        </div>\n                                                                        <div id="Playback" class="app-settings" ng-slide-down="main.app.value == \'Playback\'" lazy-render duration="1">\n                                                                              <!-- START AUDIOFILE -->\n                                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$invalid}">\n                                                                                       <label class="control-label">{{\'APPLICATION_AUDIO_FILE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                   <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="audiofile" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.display_name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="settings.soundPath+\'/\'+audio.save_name as audio in items | filter: $select.search">\n                                                                                                      <div ng-bind-html="audio.display_name | highlight: $select.search"></div>\n                                                                                             </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                                           <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_SOUNDS_AVAILABLE\' | translate }}\n                                                                                             </p>\n                                                                                          <p>\n                                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/sounds/list">{{\'APPLICATION_SOUNDS\' | translate}}</a>\n                                                                                         </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.settings.audiofile.$touched || forms.settings.$submitted) && forms.settings.audiofile.$error.required" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END AUDIOFILE -->\n\n                                                                              <!-- START OPTIONS -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_OPTIONS\' | translate}}</label>\n                                                                                  <input type="text" name="app_options" placeholder="{{ \'APPLICATION_OPTIONS\' | translate }}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                                       <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END OPTIONS -->\n                                                                  </div>\n                                                                        <div id="Dial" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && !main.app.type" lazy-render duration="1">\n                                                                            <!-- START INTERFACE -->\n                                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid}">\n                                                                                       <label class="control-label">{{ \'APPLICATION_TYPE\' | translate }}/{{ \'APPLICATION_IDENTIFIER\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                  <input type="text" name="interface" placeholder="SIP/0000" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" required>\n                                                                                 <span data-ng-show="(forms.settings.interface.$touched || forms.settings.$submitted) && forms.settings.interface.$invalid && forms.settings.interface.$error.required" class="help-block help-block-error">\n                                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END INTERFACE -->\n\n                                                                              <!-- START TIMEOUT -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                        <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                                   <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                                        <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                                        <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END OPTIONS -->\n\n                                                                                <!-- START URL -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                                    <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n                                                                                   <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END URL -->\n                                                                      </div>\n                                                                        <div id="internalDial" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && main.app.type == \'internalDial\'" lazy-render duration="1">\n                                                                         <!-- START INTERNAL DIAL -->\n                                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.user.$touched || forms.settings.$submitted) && forms.settings.user.$invalid}">\n                                                                                 <label class="control-label">{{\'APPLICATION_USER\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                 <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="user" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="user.internal as user in items | filter: $select.search">\n                                                                                                  <div ng-bind-html="user.name | highlight: $select.search"></div>\n                                                                                              </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <span data-ng-show="(forms.settings.user.$touched || forms.settings.$submitted) && forms.settings.user.$error.required" class="help-block help-block-error">\n                                                                                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END INTERNAL DIAL -->\n\n                                                                          <!-- START TIMEOUT -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                        <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                                   <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                                        <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                                        <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{ \'APPLICATION_WARNING\' | translate }}!</strong> {{ \'MESSAGE_REQUIRED_FIELD\' | translate }}.\n                                                                                     </span>\n                                                                               </div>\n                                                                                <!-- END OPTIONS -->\n\n                                                                                <!-- START URL -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                                    <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n                                                                                   <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                             <strong>{{ \'APPLICATION_WARNING\' | translate }}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                       </span>\n                                                                               </div>\n                                                                                <!-- END URL -->\n\n                                                                    </div>\n                                                                        <div id="Dial" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && main.app.type == \'externalDial\'" lazy-render duration="1">\n                                                                         <!-- START TRUNK -->\n                                                                          <div class="form-group" data-ng-class="{\'has-error\': (forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$invalid}">\n                                                                                   <label class="control-label">{{ \'APPLICATION_TRUNK\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                      <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="trunk" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="trunk.name as trunk in items | filter: $select.search">\n                                                                                                    <div ng-bind-html="trunk.name | highlight: $select.search"></div>\n                                                                                             </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                                           <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_TRUNKS_AVAILABLE\' | translate }}\n                                                                                             </p>\n                                                                                          <p>\n                                                                                                   {{ \'APPLICATION_GO_TO\' | translate }} <a href="/tools/trunks/list">{{ \'APPLICATION_TRUNKS\' | translate }}</a>\n                                                                                             </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.info.trunk.$touched || forms.info.$submitted) && forms.info.trunk.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{ \'APPLICATION_WARNING\' | translate }}!</strong> {{ \'MESSAGE_REQUIRED_FIELD\' | translate }}.\n                                                                                     </span>\n                                                                               </div>\n                                                                                <!-- END TRUNK -->\n\n                                                                          <!-- START PHONE -->\n                                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.phone.$touched || forms.settings.$submitted) && forms.settings.phone.$invalid}">\n                                                                                               <label class="control-label">{{ \'APPLICATION_PHONE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                              <input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" required>\n                                                                                                <span data-ng-show="(forms.settings.phone.$touched || forms.settings.$submitted) && forms.settings.phone.$invalid && forms.settings.phone.$error.required" class="help-block help-block-error">\n                                                                                                       <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END PHONE -->\n\n                                                                                  <!-- START TIMEOUT -->\n                                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                                <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                                           <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                                                <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n                                                                                                <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END OPTIONS -->\n\n                                                                                        <!-- START URL -->\n                                                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                                            <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[4]" data-ng-init="application.appdata[4] = null">\n                                                                                           <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END URL -->\n                                                                              </div>\n                                                                                <div id="RingGroup" class="app-settings" ng-slide-down="main.app.value == \'Dial\' && main.app.type == \'RingGroup\'" lazy-render duration="1">\n                                                                                       <!-- START ITEMS -->\n                                                                                  <input type="hidden" name="items" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="initRingGroup()">\n                                                                                     <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.items.$invalid}">\n                                                                                             <label class="control-label">{{\'APPLICATION_ITEMS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                                <div class="col-md-12" id="multi-select-user-by-role"></div>\n                                                                                          <span data-ng-show="(forms.settings.items.$touched || forms.settings.$submitted) && forms.settings.items.$error.required" class="help-block help-block-error">\n                                                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END ITEMS -->\n\n                                                                                  <!-- START TIMEOUT -->\n                                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_TIMEOUT\' | translate }}</label>\n                                                                                                <input type="text" pattern="[0-9]+" name="timeout" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null">\n                                                                                           <span data-ng-show="(forms.settings.timeout.$touched || forms.settings.$submitted) && forms.settings.timeout.$invalid && forms.settings.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 OPTIONS -->\n                                                                                        <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_OPTIONS\' | translate }}</label>\n                                                                                                <input type="text" name="app_options" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null">\n                                                                                                <span data-ng-show="(forms.settings.app_options.$touched || forms.settings.$submitted) && forms.settings.app_options.$invalid && forms.settings.app_options.$error.required" class="help-block help-block-error">\n                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END OPTIONS -->\n\n                                                                                        <!-- START URL -->\n                                                                                    <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid}">\n                                                                                           <label class="control-label">{{ \'APPLICATION_URL\' | translate }}</label>\n                                                                                            <input type="text" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[3]" data-ng-init="application.appdata[3] = null">\n                                                                                           <span data-ng-show="(forms.settings.url.$touched || forms.settings.$submitted) && forms.settings.url.$invalid && forms.settings.url.$error.required" class="help-block help-block-error">\n                                                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                         </span>\n                                                                                       </div>\n                                                                                        <!-- END URL -->\n                                                                              </div>\n                                                                        <div id="AGI" class="app-settings" ng-slide-down="main.app.value == \'AGI\'" lazy-render duration="1">\n                                                                                <!-- START PROJECT -->\n                                                                                <input type="hidden" name="url" placeholder="{{ \'APPLICATION_URL\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = \'agi://127.0.0.1/square\'">\n                                                                           <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_PROJECT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                      <ui-select data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" name="project" theme="bootstrap" required data-ng-disabled="!items.length">\n                                                                                            <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="project.name as project in items | filter: $select.search">\n                                                                                                        <div ng-bind-html="project.name | highlight: $select.search"></div>\n                                                                                           </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                                           <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_PROJECTS_AVAILABLE\' | translate }}\n                                                                                           </p>\n                                                                                          <p>\n                                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/square/projects/list">{{\'APPLICATION_PROJECTS\' | translate}}</a>\n                                                                                            </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.settings.project.$touched || forms.settings.$submitted) && forms.settings.project.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END PROJECT -->\n                                                                  </div>\n                                                                        <div id="Goto" class="app-settings" ng-slide-down="main.app.value == \'Goto\'" lazy-render duration="1">\n                                                                              <!-- START CONTEXT -->\n                                                                                <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_CONTEXT\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                      <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" name="context" theme="bootstrap" required>\n                                                                                             <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                              <ui-select-choices repeat="context.name as context in items | filter: $select.search">\n                                                                                                        <div ng-bind-html="context.name | highlight: $select.search"></div>\n                                                                                           </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <span data-ng-show="(forms.settings.context.$touched || forms.settings.$submitted) && forms.settings.context.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END CONTEXT -->\n\n                                                                                <!-- START EXTENSION -->\n                                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid}">\n                                                                                       <label class="control-label">{{ \'APPLICATION_EXTENSION\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                  <input type="text" name="extension" placeholder="" class="form-control" data-ng-model="application.appdata[1]" data-ng-init="application.appdata[1] = null" required>\n                                                                                 <span data-ng-show="(forms.settings.extension.$touched || forms.settings.$submitted) && forms.settings.extension.$invalid && forms.settings.extension.$error.required" class="help-block help-block-error">\n                                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END EXTENSION -->\n\n                                                                              <!-- START PRIORITY -->\n                                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid}">\n                                                                                 <label class="control-label">{{ \'APPLICATION_PRIORITY\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                   <input type="text" pattern="[0-9]+" name="priority" placeholder="" class="form-control" data-ng-model="application.appdata[2]" data-ng-init="application.appdata[2] = null" required>\n                                                                                 <span data-ng-show="(forms.settings.priority.$touched || forms.settings.$submitted) && forms.settings.priority.$invalid" class="help-block help-block-error">\n                                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END PRIORITY -->\n                                                                 </div>\n                                                                        <div id="Hangup" class="app-settings" ng-slide-down="main.app.value == \'Hangup\'" lazy-render duration="1">\n                                                                          <!-- START HANGUPCAUSE -->\n                                                                            <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$invalid}">\n                                                                                   <label class="control-label">{{\'APPLICATION_HANGUP_CAUSE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                 <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="hangupCause" required>\n                                                                                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                          <ui-select-choices repeat="hangupCause.value as hangupCause in $application.hangupCauses | filter: $select.search">\n                                                                                                   <div ng-bind-html="hangupCause.name  | translate | highlight: $select.search"></div>\n                                                                                          </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <span data-ng-show="(forms.settings.hangupCause.$touched || forms.settings.$submitted) && forms.settings.hangupCause.$error.required" class="help-block help-block-error">\n                                                                                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END HANGUPCAUSE -->\n                                                                      </div>\n                                                                        <div id="Set" class="app-settings" ng-slide-down="main.app.value == \'Set\'" lazy-render duration="1">\n                                                                                <!-- START VARIABLE -->\n                                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid}">\n                                                                                 <label class="control-label">{{ \'APPLICATION_VARIABLE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                   <input type="text" name="variable" placeholder="" class="form-control" data-ng-model="application.variable" data-ng-init="application.appdata[0] = null" data-ng-change="updateSetAppdata()" required>\n                                                                                        <span data-ng-show="(forms.settings.variable.$touched || forms.settings.$submitted) && forms.settings.variable.$invalid && forms.settings.variable.$error.required" class="help-block help-block-error">\n                                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END VARIABLE -->\n\n                                                                               <!-- START VARVALUE -->\n                                                                               <div class="form-group" data-ng-class="{\'has-error\': (forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid}">\n                                                                                 <label class="control-label">{{ \'APPLICATION_VALUE\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                      <input type="text" name="varvalue" placeholder="" class="form-control" data-ng-model="application.value" data-ng-change="updateSetAppdata()" required>\n                                                                                        <span data-ng-show="(forms.settings.varvalue.$touched || forms.settings.$submitted) && forms.settings.varvalue.$invalid && forms.settings.varvalue.$error.required" class="help-block help-block-error">\n                                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END VARVALUE -->\n                                                                 </div>\n                                                                        <div id="Custom" class="app-settings" ng-slide-down="main.app.type == \'custom\'" lazy-render duration="1">\n\n                                                                         <!-- START CUSTOMAPP -->\n                                                                              <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid}">\n                                                                                      <label class="control-label">{{ \'APPLICATION_CUSTOM_APP\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                 <input type="text" name="customApp" placeholder="{{ \'APPLICATION_CUSTOM_APP\' | translate }}" class="form-control" data-ng-model="application.app" required>\n                                                                                 <span data-ng-show="(forms.settings.customApp.$touched || forms.settings.$submitted) && forms.settings.customApp.$invalid && forms.settings.customApp.$error.required" class="help-block help-block-error">\n                                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END CUSTOMAPP -->\n\n                                                                              <!-- START APPDATA -->\n                                                                                <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid}">\n                                                                                  <label class="control-label">{{ \'APPLICATION_ARGUMENTS\' | translate }}</label>\n                                                                                      <input type="text" name="appdata" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}" class="form-control" data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null">\n                                                                                 <span data-ng-show="(forms.settings.appdata.$touched || forms.settings.$submitted) && forms.settings.appdata.$invalid && forms.settings.appdata.$error.required" class="help-block help-block-error">\n                                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END APPDATA -->\n                                                                  </div>\n                                                                        <div id="Voicemail" class="app-settings" ng-slide-down="main.app.value == \'Voicemail\'" lazy-render duration="1">\n                                                                            <!-- START VOICEMAIL -->\n                                                                              <div class="form-group"  data-ng-class="{\'has-error\': (forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid}">\n                                                                                      <label class="control-label">{{ \'APPLICATION_MAILBOX\' | translate }}@{{ \'APPLICATION_CONTEXT\' | translate }}<span class="required" aria-required="true">*</span></label>\n                                                                                  <ui-select data-ng-model="application.appdata[0]" data-ng-init="application.appdata[0] = null" theme="bootstrap" name="voicemail" required data-ng-disabled="!items.length">\n                                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.mailbox}}</ui-select-match>\n                                                                                           <ui-select-choices repeat="mailbox.mailbox+\'@\'+mailbox.context as mailbox in items | filter: $select.search">\n                                                                                                       <div ng-bind-html="mailbox.mailbox | highlight: $select.search"></div>\n                                                                                                </ui-select-choices>\n                                                                                  </ui-select>\n                                                                                  <div class="note note-warning" data-ng-hide="items.length">\n                                                                                           <h4 class="block">Warning!</h4>\n                                                                                               <p>\n                                                                                                   {{ \'MESSAGE_NO_VOICEMAILS_AVAILABLE\' | translate }}\n                                                                                         </p>\n                                                                                          <p>\n                                                                                                   {{\'APPLICATION_GO_TO\' | translate}} <a href="/channels/voice/voicemails/list">{{\'APPLICATION_VOICEMAILS\' | translate}}</a>\n                                                                                                </p>\n                                                                                  </div>\n                                                                                        <span data-ng-show="(forms.settings.voicemail.$touched || forms.settings.$submitted) && forms.settings.voicemail.$invalid && forms.settings.voicemail.$error.required" class="help-block help-block-error">\n                                                                                           <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END VOICEMAIL -->\n                                                                        </div>\n                                                                        <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                          </form>\n                                                               </wz-step>\n                                                                    <wz-step title="{{\'APPLICATION_INTERVAL\' | translate}}" canexit="formValidation(forms.interval.IntervalId.$valid || forms.interval.hasOwnProperty(\'t_from\') || forms.interval.intType.$modelValue === \'always\')">\n                                                                               <form name="forms.interval" novalidate>\n                                                                               <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                                  <!-- START INTERVAL_TYPE -->\n                                                                  <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$invalid}">\n                                                                           <label class="control-label">{{\'APPLICATION_INTERVAL_TYPE\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                                <ui-select data-ng-model="interval.intType" theme="bootstrap" name="intType" required>\n                                                                                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                  <ui-select-choices repeat="intType.value as intType in $application.intTypes | filter: $select.search">\n                                                                                               <div ng-bind-html="intType.name | translate | highlight: $select.search"></div>\n                                                                                       </ui-select-choices>\n                                                                          </ui-select>\n                                                                          <span data-ng-show="(forms.interval.intType.$touched || forms.interval.$submitted) && forms.interval.intType.$error.required" class="help-block help-block-error">\n                                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                         </span>\n                                                                       </div>\n                                                                        <!-- END INTERVAL_TYPE -->\n                                                                    <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'custom\'" lazy-render duration="1">\n                                                                                        <!-- START TIME -->\n                                                                                   <div class="form-group">\n                                                                                              <label class="control-label">{{ \'APPLICATION_TIME\' | translate }}</label>\n                                                                                           <div class="input-group input-large">\n                                                                                                 <fieldset class="pull-left" ng-disabled="interval.alwaysTime"><uib-timepicker name="t_from" data-ng-model="interval.t_from" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                                                  <div class="input-group-addon col-md-1 interval-to pull-left">to</div>\n                                                                                                        <fieldset ng-disabled="interval.alwaysTime"><uib-timepicker  name="t_to" data-ng-model="interval.t_to" show-meridian="false" show-spinners="false"></uib-timepicker></fieldset>\n                                                                                               </div>\n                                                                                        </div>\n                                                                                        <!-- END TIME -->\n\n                                                                                   <!-- <label class="control-label pointer-cursor"><input type="checkbox" data-ng-model="interval.alwaysTime">{{\'APPLICATION_ALWAYS\' | translate}}</label> -->\n                                                                                        <!-- START ALWAYS -->\n                                                                                 <div class="form-group">\n                                                                                              <label class="control-label">{{ \'APPLICATION_ALWAYS\' | translate }}</label>\n                                                                                         <div class="input-group input-large">\n                                                                                                 <label class="control-label pointer-cursor">\n                                                                                                          <input\n                                                                                                                        bs-switch\n                                                                                                                     data-ng-model="interval.alwaysTime"\n                                                                                                                   type="checkbox"\n                                                                                                                       switch-active="{{ alwaysSwitch.isActive }}"\n                                                                                                                   switch-on-text="{{ \'APPLICATION_YES\' | translate }}"\n                                                                                                                        switch-off-text="{{ \'APPLICATION_NO\' | translate }}"\n                                                                                                                        switch-on-color="{{ alwaysSwitch.onColor }}"\n                                                                                                                  switch-off-color="{{ alwaysSwitch.offColor }}"\n                                                                                                                        switch-animate="{{ alwaysSwitch.animate }}"\n                                                                                                                   switch-size="{{ alwaysSwitch.size }}"\n                                                                                                                 switch-label="{{ alwaysSwitch.label }}"\n                                                                                                                       switch-icon="{{ alwaysSwitch.icon }}"\n                                                                                                                 switch-radio-off="{{ alwaysSwitch.radioOff }}"\n                                                                                                                        switch-label-width="{{ alwaysSwitch.labelWidth }}"\n                                                                                                                    switch-handle-width="{{ alwaysSwitch.handleWidth }}">\n                                                                                                 </label>\n                                                                                              </div>\n                                                                                        </div>\n                                                                                        <!-- END ALWAYS -->\n\n                                                                                 <!-- START WEEKDAY -->\n                                                                                        <div class="form-group">\n                                                                                              <label class="control-label">{{ \'APPLICATION_WEEKDAY\' | translate }}</label>\n                                                                                                <div class="input-group input-large">\n                                                                                                 <ui-select data-ng-model="interval.wd_from" theme="bootstrap" name="wd_from">\n                                                                                                         <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                                        {{weekDay.name | translate}}\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span class="input-group-addon">to</span>\n                                                                                                     <ui-select data-ng-model="interval.wd_to" theme="bootstrap" name="wd_to">\n                                                                                                             <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="weekDay.value as weekDay in $interval.daysOfWeek | filter: $select.search">\n                                                                                                                        {{weekDay.name | translate}}\n                                                                                                          </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                        </div>\n                                                                                        <!-- END WEEKDAY -->\n\n                                                                                        <!-- START MONTHDAY -->\n                                                                                       <div class="form-group">\n                                                                                              <label class="control-label">{{ \'APPLICATION_MONTHDAY\' | translate }}</label>\n                                                                                               <div class="input-group input-large">\n                                                                                                 <ui-select data-ng-model="interval.md_from" theme="bootstrap" name="md_from">\n                                                                                                         <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                                                <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                                                       {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                                           </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span class="input-group-addon">to</span>\n                                                                                                     <ui-select data-ng-model="interval.md_to" theme="bootstrap" name="md_to">\n                                                                                                             <ui-select-match>{{$select.selected === \'always\' ? \'APPLICATION_ALWAYS\' : $select.selected | translate}}</ui-select-match>\n                                                                                                                <ui-select-choices repeat="monthDay in $interval.daysOfMonth | filter: $select.search">\n                                                                                                                       {{monthDay === \'always\' ? \'APPLICATION_ALWAYS\' : monthDay | translate}}\n                                                                                                           </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                        </div>\n                                                                                        <!-- END MONTHDAY -->\n\n                                                                                       <!-- START MONTH -->\n                                                                                  <div class="form-group">\n                                                                                              <label class="control-label">{{ \'APPLICATION_MONTH\' | translate }}</label>\n                                                                                          <div class="input-group input-large">\n                                                                                                 <ui-select data-ng-model="interval.m_from" theme="bootstrap" name="m_from">\n                                                                                                           <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                                        {{month.name | translate}}\n                                                                                                            </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                                  <span class="input-group-addon">to</span>\n                                                                                                     <ui-select data-ng-model="interval.m_to" theme="bootstrap" name="m_to">\n                                                                                                               <ui-select-match placeholder="">{{$select.selected.name | translate}}</ui-select-match>\n                                                                                                               <ui-select-choices repeat="month.value as month in $interval.months | filter: $select.search">\n                                                                                                                        {{month.name | translate}}\n                                                                                                            </ui-select-choices>\n                                                                                                  </ui-select>\n                                                                                          </div>\n                                                                                        </div>\n                                                                                        <!-- END MONTH -->\n                                                    </div>\n\n                                                      <div id="customInterval" class="app-settings" ng-slide-down="interval.intType == \'list\'" lazy-render duration="1">\n\n                                                                <!-- START INTERVALS -->\n                                                              <div class="form-group" data-ng-class="{\'has-error\': (forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$invalid}">\n                                                                     <label class="control-label">{{\'APPLICATION_INTERVALS\' | translate}}<span class="required" aria-required="true">*</span></label>\n                                                                    <ui-select data-ng-model="interval.IntervalId" theme="bootstrap" name="IntervalId" required>\n                                                                          <ui-select-match placeholder="{{\'APPLICATION_SEARCH_FILTER\' | translate}}">{{$select.selected.name | translate}}</ui-select-match>\n                                                                          <ui-select-choices repeat="interval.id as interval in Intervals | filter: $select.search">\n                                                                                    {{interval.name | translate}}\n                                                                         </ui-select-choices>\n                                                                  </ui-select>\n                                                                  <div class="note note-warning" data-ng-hide="intervals.length">\n                         <h4 class="block">Warning!</h4>\n                       <p>\n                     {{ \'MESSAGE_NO_INTERVAL_AVAILABLE\' | translate }}\n                         </p>\n                          <p>\n                     {{\'APPLICATION_GO_TO\' | translate}} <a href="/tools/intervals/list">{{\'APPLICATION_INTERVALS\' | translate}}</a>\n                         </p>\n                        </div>\n                                                                        <span data-ng-show="(forms.interval.IntervalId.$touched || forms.interval.$submitted) && forms.interval.IntervalId.$error.required" class="help-block help-block-error">\n                                                                              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END INTERVALS -->\n\n                                                      </div>\n                                                                <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                             <button class="btn green-haze" type="submit" ng-click="goNext()">{{\'APPLICATION_CONTINUE\' | translate}} <i class="fa fa-angle-right"></i></button>\n                                                  </form>\n                                               </wz-step>\n\n                                          <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <button class="btn green-haze" type="button" ng-click="previous()"><i class="fa fa-angle-left"></i> {{\'APPLICATION_BACK\' | translate}}</button>\n                                                     <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
@@ -61,7 +61,7 @@ a.put("app/dashboard/mail/mail.html",'<div data-ng-switch="Auth.getRole()">\n  <
 a.put("app/desk/view/view.account.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_ACCOUNT\' | 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_GENERALS\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\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.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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="account.name" required/>\n                                                                <span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END NAME -->\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n                                                            <span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n                                                            <span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START AUTH TYPE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n                                                              <ui-select data-ng-model="account.authType" name="authType" theme="bootstrap" required>\n                                                                       <ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                        <ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n                                                                          <div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n                                                                      </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="account.authType == \'basic\'" lazy-render duration="1">\n                                                          <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="password" name="password" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" class="form-control" data-ng-model="account.password" required/>\n                                                                <span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n                                                       <!-- START CONSUMER KEY -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n                                                               <label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="account.consumerKey" required/>\n                                                          <span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n                                                            <label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="account.consumerSecret" required/>\n                                                         <span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n                                                             <label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                               <input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="account.token" required/>\n                                                             <span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="account.authType == \'oauth\'" lazy-render duration="1">\n                                                               <label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="account.tokenSecret" required/>\n                                                          <span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TOKEN SECRET-->\n\n                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n\n                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/desk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n        <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n                              </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createConfiguration()">\n            <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n                                                   <form name="formsConfiguration.info" novalidate>\n                                                              <!-- START NAME -->\n                                                           <div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.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="configuration.name" required/>\n                                                                  <span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END NAME -->\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="configuration.description"/>\n                                                              </div>\n                                                                <!-- END DESCRIPTION -->\n\n                                                            <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n                                                       </form>\n                                               </wz-step>\n\n                                          <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                                   <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/desk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\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_CONFIGURATION\' | translate}}: {{configurationName}}</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_SUBJECT\' | translate}}</a>\n                                      </li>\n          <li>\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n                                  </li>\n          <li>\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n                                       </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- SUBJECT TAB -->\n                                  <div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                          <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n                 <div class="col-md-3">\n                  <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                     <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                         <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n                    </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n                        <div class="form-group">\n                        <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n                      </div>\n                      </div>\n                <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n                      <div class="form-group">\n                        <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n                  </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n                                  <div class="tab-pane ui-padding" id="tab_1_2">\n                                                <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                            <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                                                    <div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n                                                               <!-- <pre>\n                                                                    {{descriptionItem|json}}\n                                                              </pre> -->\n                  <div class="col-md-2">\n                  <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n                        <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n                     <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n                       </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n                    <div class="form-group">\n                        <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n                      </div>\n                      </div>\n                                                          <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n                                                                       <input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n                                                          </div>\n                                                                <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n                                                                       <ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                     <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                         <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n                    </ui-select-choices>\n                        </ui-select>\n                                                          </div>\n                                                                <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n                                                                        <input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n                                                         </div>\n                      <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n                        <div class="form-group">\n                        <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n                      </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n                                   <div class="tab-pane ui-padding" id="tab_1_3">\n                                                <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                             <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n                     <div class="col-md-3">\n                  <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n                    <ui-select-choices repeat="item.id as item in accountFields | filter: $select.search">\n                          <div ng-bind-html="item.label | highlight: $select.search"></div>\n                   </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n                    <div class="form-group">\n                                                                              <ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected}}</ui-select-match>\n                                  <ui-select-choices repeat="item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n                                  <div ng-bind-html="item | highlight: $select.search"></div>\n                                 </ui-select-choices>\n                                </ui-select>\n                  </div>\n                      </div>\n                                                          <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n                                                                 <div class="form-group">\n                                                                              <ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n                                <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                                 <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n                               </ui-select-choices>\n                                </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n                        <div class="form-group">\n                                                                              <input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n                    </div>\n                      </div>\n                                                          <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n                      <div class="form-group">\n                                                                              <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n                    </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END FIELDS TAB -->\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/desk/view/view.configurations.html",'<div ui-view class="profile-content">\n      <div class="row" data-ng-init="getConfigurations()">\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_CONFIGURATIONS\' | translate}}</span>\n                                  </div>\n                                        <div class="actions">\n                                         <div class="btn-group">\n                                                       <a class="btn green-jungle " href="/desk/view/{{account.id}}/configuration" data-toggle="dropdown">\n                                                           <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n                                                 </a>\n                                          </div>\n                                        </div>\n                                </div>\n                                <div class="portlet-body">\n                                    <!-- START TABLE -->\n                                  <table class="table table-striped table-bordered table-hover">\n                                                  <thead>\n                                                       <tr>\n                                                            <th>{{\'APPLICATION_NAME\' | translate}}</th>\n                                                                     <th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n                                                                  <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n                                                      </tr>\n                                                 </thead>\n                                                    <tbody>\n                                                   <tr data-ng-repeat="configuration in configurations">\n                                                                     <td>{{configuration.name}}</td>\n                                                                       <td>{{configuration.description}}</td>\n                                                      <td>\n                                                                            <a class="btn default btn-xs blue-stripe" data-ng-href="/desk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n                                                                                      {{ \'APPLICATION_SETTINGS\' | translate}}\n                                                     </a>\n                                                  <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n                                                                                    {{ \'APPLICATION_DELETE\' | translate }}\n                                                      </a>\n                                                </td>\n                                               </tr>\n                                                             <tr data-ng-hide="configurations.length">\n                                                                     <td colspan="5" style="text-align:center;">\n                                                                           <i>No configuration available</i>\n                                                                     </td>\n                                                         </tr>\n                                           </tbody>\n                                    </table>\n                                      <!-- END TABLE -->\n                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/desk/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-handbag"></i>\n          <a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n                                   <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <a href="#">{{account.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 src="assets/images/media/desk.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                                          {{account.name}}\n                                      </div>\n                                        <div class="profile-usertitle-job">\n                                           {{account.remoteUri}}\n                                 </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n                               <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.desk.view.account\')}">\n                                                  <a ng-href="/desk/view/{{account.id}}/account">\n                                                       <i class="icon-user"></i>\n                                                     {{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n                                                </li>\n                                         <li data-ng-class="{active: $state.includes(\'main.desk.view.configurations\') || $state.is(\'main.desk.view.configuration\')}">\n                                                      <a ng-href="/desk/view/{{account.id}}/configurations">\n                                                        <i class="icon-settings"></i>\n                                                 {{ \'APPLICATION_CONFIGURATIONS\' | 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/desk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\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-handbag"></i>\n                                          <a href="/desk/list">{{ \'APPLICATION_DESK_COM\' | translate }}</a>\n                                   </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n                                                <form name="forms.formSetting" novalidate>\n\n                                                  <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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.formSetting.name.$invalid && forms.formSetting.$submitted" 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                                                              <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n                                                       </div>\n                                                        <!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="text" name="username" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/desk/accounts/validate/username"/>\n                                                         <span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n                                       </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/desk/accounts/validate/remoteUri"/>\n                                                             <span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n                                 </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START AUTH TYPE -->\n                                                      <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.authType.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}</label>\n                                                              <ui-select data-ng-model="item.authType" name="authType" theme="bootstrap" required>\n                                                                  <ui-select-match placeholder="{{\'APPLICATION_AUTHENTICATION_TYPE\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                                                                        <ui-select-choices repeat="type in [\'basic\', \'oauth\'] | filter: $select.search">\n                                                                          <div data-ng-bind="type | capitalize | highlight: $select.search"></div>\n                                                                      </ui-select-choices>\n                                                          </ui-select>\n                                                          <span data-ng-show="forms.formSetting.authType.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- START AUTH TYPE -->\n\n              <!-- START PASSWORD -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.password.$invalid}" ng-slide-down="item.authType == \'basic\'" lazy-render duration="1">\n                                                             <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="password" name="password" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="item.password" required/>\n                                                               <span data-ng-show="forms.formSetting.password.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END PASSWORD -->\n\n              <!-- START CONSUMER KEY -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerKey.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n                                                          <label class="control-label">{{\'APPLICATION_CONSUMER_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="consumerKey" placeholder="{{\'APPLICATION_CONSUMER_KEY\' | translate}}" class="form-control" data-ng-model="item.consumerKey" required/>\n                                                             <span data-ng-show="forms.formSetting.consumerKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONSUMER KEY -->\n\n              <!-- START CONSUMER SECRET -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.consumerSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n                                                               <label class="control-label">{{\'APPLICATION_CONSUMER_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="consumerSecret" placeholder="{{\'APPLICATION_CONSUMER_SECRET\' | translate}}" class="form-control" data-ng-model="item.consumerSecret" required/>\n                                                            <span data-ng-show="forms.formSetting.consumerSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END CONSUMER SECRET -->\n\n              <!-- START TOKEN -->\n                                                    <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.token.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n                                                                <label class="control-label">{{\'APPLICATION_TOKEN\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                               <input type="text" name="token" placeholder="{{\'APPLICATION_TOKEN\' | translate}}" class="form-control" data-ng-model="item.token" required/>\n                                                                <span data-ng-show="forms.formSetting.token.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TOKEN -->\n\n              <!-- START TOKEN SECRET-->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.tokenSecret.$invalid}" ng-slide-down="item.authType == \'oauth\'" lazy-render duration="1">\n                                                          <label class="control-label">{{\'APPLICATION_TOKEN_SECRET\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                <input type="text" name="tokenSecret" placeholder="{{\'APPLICATION_TOKEN_SECRET\' | translate}}" class="form-control" data-ng-model="item.tokenSecret" required/>\n                                                             <span data-ng-show="forms.formSetting.tokenSecret.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END TOKEN SECRET-->\n\n                                                    <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n                                               </form>\n                                       </wz-step>\n\n                                  <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                 </wz-step>\n\n                          </wizard>\n\n                   </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/freshdesk/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-handbag"></i>\n                                  <a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n                             </li>\n                 </ul>\n         </div>\n\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-handbag font-green-sharp"></i>\n                                 <span class="caption-subject">{{ \'APPLICATION_FRESHDESK\' | translate }}</a> </span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group" data-ng-show="accounts.checked.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                                               <a class="btn green-jungle" href="/freshdesk/wizard">\n                                                 <i class="icon-plus"></i> {{ \'APPLICATION_NEW_ACCOUNT\' | translate }}\n                                               </a>\n                                  </div>\n                                        <a class="btn btn-icon-only btn-default" href="#" ng-csv="getAccounts([\'name\',\'username\',\'remoteUri\',\'apiKey\'])" csv-header="[\'Name\', \'Username\', \'Remote Address\', \'Api Key\']" field-separator=";" filename="freshdesk_accounts.csv">\n                                        <i class="icon-cloud-download"></i></a>\n                               </div>\n                        </div>\n                        <div class="portlet-body">\n                            <!-- START TABLE -->\n                          <table st-table="displayedFreshdeskAccounts" st-pipe="initList" class="table table-striped table-bordered table-hover">\n                                       <div class="table-responsive">\n                                          <thead>\n                                                     <tr>\n                                                          <th colspan="7">\n                                                                      <div class="row">\n                                                                             <div class="col-md-6">\n                                                                                        <ui-select class="input-xsmall" ng-model="conf.accountsByPage" theme="bootstrap" ng-disabled="disabled">\n                                                                                              <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                                                                                             <ui-select-choices repeat="accountByPage in accountsByPage | filter: $select.search">\n                                                                                                 <div ng-bind-html="accountByPage.name | highlight: $select.search"></div>\n                                                                                             </ui-select-choices>\n                                                                                  </ui-select>\n                                                                          </div>\n                                                                                <div class="col-md-6">\n                                                                                        <div class="input-group input-medium pull-right">\n                                                                                             <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n                                                                                         <span class="input-group-addon">\n                                                                                                      <i class="fa fa-search"></i>\n                                                                                          </span>\n                                                                                       </div>\n                                                                                </div>\n                                                                        </div>\n                                                                </th>\n                                                 </tr>\n                                           <tr>\n                                                                <th class="small-cells" style="text-align: center; vertical-align: middle"><input type="checkbox" ng-change="check(account, checked)" checklist-model checklist-value="id"></th>\n                                                  <th st-sort="name">{{ \'APPLICATION_NAME\' | translate }}</th>\n                                                <th st-sort="username">{{ \'APPLICATION_EMAIL\' | translate }}</th>\n                                                               <th st-sort="remoteUri">{{ \'APPLICATION_REMOTE_ADDRESS\' | translate }}</th>\n                                                         <th>{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n                                                                <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n                                              </tr>\n                                         </thead>\n                                      <tbody>\n                                         <tr data-ng-repeat="account in displayedFreshdeskAccounts" class="animate-repeat">\n                                                                <td style="text-align: center; vertical-align: middle"><input type="checkbox" checklist-model="accounts.checked" checklist-value="account.id"></td>\n                                         <td>{{account.name}}</td>\n                                             <td>{{account.username}}</td>\n                                                           <td>{{account.remoteUri}}</td>\n                                                                <td>{{account.description}}</td>\n                                            <td>\n                                            <a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/account">\n                                                                              {{ \'APPLICATION_EDIT\' | translate }}\n                                                </a>\n                                                                  <a class="btn default btn-xs green-stripe" data-ng-click="checkAccount(account.id)">\n                                                                          {{ \'APPLICATION_CHECK\' | translate }}\n                                               </a>\n                                          <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(account.name,account.id)">\n                                                                         {{ \'APPLICATION_DELETE\' | translate }}\n                                              </a>\n                                        </td>\n                                       </tr>\n                                                     <tr data-ng-hide="displayedFreshdeskAccounts.length">\n                                                         <td colspan="7" style="text-align:center;">\n                                                                   <i>No account available</i>\n                                                           </td>\n                                                 </tr>\n                                   </tbody>\n                                      <tfoot>\n                                                     <tr>\n                                                          <td/>\n                                             <td>\n                                                                      <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n                                                                        </div>\n                                                    </td>\n                                                 <td>\n                                                                      <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="email" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_EMAIL\' | translate | lowercase}}" class="form-control" type="search"/>\n                                                                      </div>\n                                                    </td>\n                                                 <td>\n                                                                      <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="remoteUri" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_REMOTE_ADDRESS\' | translate | lowercase}}" class="form-control" type="search"/>\n                                                                 </div>\n                                                    </td>\n                                                 <td/>\n                                                             <td/>\n                                           </tr>\n                                           <tr>\n                                            <td colspan="7" class="text-center">\n                                                                    <div class="pagination" st-pagination st-items-by-page="conf.accountsByPage.value" st-displayed-pages="7"></div>\n                                            </td>\n                                       </tr>\n                                       </tfoot>\n                                    </div>\n                                </table>\n                              <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.account.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_ACCOUNT\' | 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_GENERALS\' | translate}}</a>\n                                     </li>\n                         </ul>\n                 </div>\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.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n              <!-- START NAME -->\n                                                       <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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="account.name" required/>\n                                                                <span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                     <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END NAME -->\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="account.description"/>\n                                                    </div>\n                                                        <!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="account.username" required/>\n                                                            <span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n              <!-- START REMOTE ADDRESS -->\n                                                  <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="account.remoteUri" required />\n                                                            <span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n                                                       <!-- START API KEY -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="account.apiKey" required/>\n                                                         <span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END API KEY -->\n\n                                                        <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}"/>\n                                          </form>\n                                       </div>\n                                        <!-- END GENERAL TAB -->\n\n                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/freshdesk/view/view.configuration.html",'<div class="row" data-ng-init="initConfiguration()">\n   <div class="col-md-12">\n               <!-- BEGIN  PORTLET-->\n                <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_CONFIGURATION\' | translate }} WIZARD</a> </span>\n                              </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createConfiguration()">\n            <wz-step title="{{\'APPLICATION_SETTINGS\' | translate}}" canexit="formValidation(formsConfiguration.info.$valid)">\n                                                   <form name="formsConfiguration.info" novalidate>\n                                                              <!-- START NAME -->\n                                                           <div class="form-group" data-ng-class="{\'has-error\': formsConfiguration.info.$submitted && formsConfiguration.info.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="configuration.name" required/>\n                                                                  <span data-ng-show="formsConfiguration.info.name.$invalid && formsConfiguration.info.$submitted" class="help-block help-block-error">\n                                                                         <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                 </span>\n                                                               </div>\n                                                                <!-- END NAME -->\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="configuration.description"/>\n                                                              </div>\n                                                                <!-- END DESCRIPTION -->\n\n                                                            <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="goNext()"/>\n                                                       </form>\n                                               </wz-step>\n\n                                          <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                                     <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                                    <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                                   <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                         </wz-step>\n                            </wizard>\n                     </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/freshdesk/view/view.configurationSettings.html",'<div class="row" data-ng-init="getConfiguration();getVariables();getFields();">\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_CONFIGURATION\' | translate}}: {{configurationName}}</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_SUBJECT\' | translate}}</a>\n                                      </li>\n          <li>\n                                         <a href="#" data-target="#tab_1_2" data-toggle="tab">{{\'APPLICATION_DESCRIPTION\' | translate}}</a>\n                                  </li>\n          <li>\n                                         <a href="#" data-target="#tab_1_3" data-toggle="tab">{{\'APPLICATION_FIELDS\' | translate}}</a>\n                                       </li>\n                         </ul>\n                 </div>\n                        <div class="portlet-body">\n                            <div class="tab-content">\n                                     <!-- SUBJECT TAB -->\n                                  <div class="tab-pane ui-padding active" id="tab_1_1">\n            <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by blank space:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemSubject()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                          <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                <div class="row" data-ng-repeat="subjectItem in subjectConfig">\n                 <div class="col-md-3">\n                  <ui-select ng-model="subjectItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(subjectItem)">\n                       <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                     <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                         <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n                    </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-8" data-ng-if="subjectItem.type==\'string\'">\n                        <div class="form-group">\n                        <input type="text" class="form-control" data-ng-model="subjectItem.content" data-ng-change="updateField(subjectItem)">\n                      </div>\n                      </div>\n                <div class="col-md-8" data-ng-if="subjectItem.type==\'variable\'">\n                      <div class="form-group">\n                        <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="subjectItem.VariableId" data-ng-change="updateField(subjectItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(subjectItem)"><i class="fa fa-times"></i></button>\n                  </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END SUBJECT TAB -->\n          <!-- DESCRIPTION TAB -->\n                                  <div class="tab-pane ui-padding" id="tab_1_2">\n                                                <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">All following fields will be join by new line:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemDescription()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                            <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                                                    <div class="row" data-ng-repeat="descriptionItem in descriptionConfig">\n                                                               <!-- <pre>\n                                                                    {{descriptionItem|json}}\n                                                              </pre> -->\n                  <div class="col-md-2">\n                  <ui-select ng-model="descriptionItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n                        <ui-select-choices repeat="item in descFieldType | filter: $select.search">\n                     <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n                       </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-9" data-ng-if="descriptionItem.type==\'string\'">\n                    <div class="form-group">\n                        <input type="text" class="form-control" data-ng-model="descriptionItem.content" data-ng-change="updateField(descriptionItem)">\n                      </div>\n                      </div>\n                                                          <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n                                                                       <input type="text" class="form-control" placeholder="Key" data-ng-model="descriptionItem.key" data-ng-change="updateField(descriptionItem)">\n                                                          </div>\n                                                                <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\'">\n                                                                       <ui-select ng-model="descriptionItem.keyType" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeDescType(descriptionItem)">\n                        <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | capitalize}}</ui-select-match>\n                     <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                         <div ng-bind-html="item | highlight: $select.search | capitalize"></div>\n                    </ui-select-choices>\n                        </ui-select>\n                                                          </div>\n                                                                <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'string\'">\n                                                                        <input type="text" class="form-control" placeholder="Value" data-ng-model="descriptionItem.keyContent" data-ng-change="updateField(descriptionItem)">\n                                                         </div>\n                      <div class="col-md-3" data-ng-if="descriptionItem.type==\'key_value\' && descriptionItem.keyType==\'variable\'">\n                        <div class="form-group">\n                        <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="descriptionItem.VariableId" data-ng-change="updateField(descriptionItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(descriptionItem)"><i class="fa fa-times"></i></button>\n                      </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END DESCRIPTION TAB -->\n          <!-- FIELDS TAB -->\n                                   <div class="tab-pane ui-padding" id="tab_1_3">\n                                                <div class="row">\n              <div class="col-md-11">\n                <span class="caption-subject">Add how to fill the fields present in your account:</span>\n              </div>\n              <div class="col-md-1 pull-rigth">\n                <button class="btn btn-icon-only green" data-ng-click="addItemField()"><i class="fa fa-plus"></i></button>\n              </div>\n            </div>\n            <hr>\n                                             <!-- <div ng-scrollbars ng-scrollbars-config="config"> -->\n                <div class="row" data-ng-repeat="fieldItem in fieldConfig">\n                     <div class="col-md-3">\n                  <ui-select ng-model="fieldItem.idField" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeFieldType(fieldItem)">\n                   <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.label}}</ui-select-match>\n                    <ui-select-choices repeat="item.name as item in accountFields | filter: $select.search">\n                        <div ng-bind-html="item.label | highlight: $select.search"></div>\n                   </ui-select-choices>\n                        </ui-select>\n                </div>\n                <div class="col-md-8" data-ng-if="getSystemFieldOptions(fieldItem.idField)">\n                    <div class="form-group">\n                                                                              <ui-select ng-model="fieldItem.content" theme="bootstrap" ng-disabled="disabled" data-ng-change="updateField(fieldItem)">\n                               <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected[0]}}</ui-select-match>\n                               <ui-select-choices repeat="item[0] as item in getSystemFieldOptions(fieldItem.idField) | filter: $select.search">\n                               <div ng-bind-html="item[0] | highlight: $select.search"></div>\n                              </ui-select-choices>\n                                </ui-select>\n                  </div>\n                      </div>\n                                                          <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField)">\n                                                                 <div class="form-group">\n                                                                              <ui-select ng-model="fieldItem.type" theme="bootstrap" ng-disabled="disabled" data-ng-change="changeType(fieldItem)">\n                           <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected | ucfirst}}</ui-select-match>\n                                <ui-select-choices repeat="item in fieldType | filter: $select.search">\n                                 <div ng-bind-html="item | highlight: $select.search | ucfirst"></div>\n                               </ui-select-choices>\n                                </ui-select>\n                                                                  </div>\n                                                                </div>\n                                                                <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'string\'">\n                        <div class="form-group">\n                                                                              <input type="text" class="form-control" data-ng-model="fieldItem.content" data-ng-change="updateField(fieldItem)">\n                    </div>\n                      </div>\n                                                          <div class="col-md-4" data-ng-if="!getSystemFieldOptions(fieldItem.idField) && fieldItem.type === \'variable\'">\n                      <div class="form-group">\n                                                                              <ui-select theme="bootstrap" ng-disabled="disabled" data-ng-model="fieldItem.VariableId" data-ng-change="updateField(fieldItem)">\n                         <ui-select-match placeholder="{{\'APPLICATION_SEARCH\' | translate}}">{{$select.selected.name}}</ui-select-match>\n                     <ui-select-choices repeat="variable.id as variable in variables | filter: $select.search">\n                              <div ng-bind-html="variable.name | highlight: $select.search"></div>\n                        </ui-select-choices>\n                        </ui-select>\n                        </div>\n                      </div>\n                <div class="col-md-1">\n                  <div class="form-group">\n                        <button class="btn btn-icon-only red" data-ng-click="removeItem(fieldItem)"><i class="fa fa-times"></i></button>\n                    </div>\n                      </div>\n              </div>\n                                            <!-- </div> -->\n                                       </div>\n                                        <!-- END FIELDS TAB -->\n                               </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/freshdesk/view/view.configurations.html",'<div ui-view class="profile-content">\n <div class="row" data-ng-init="getConfigurations()">\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_CONFIGURATIONS\' | translate}}</span>\n                                  </div>\n                                        <div class="actions">\n                                         <div class="btn-group">\n                                                       <a class="btn green-jungle " href="/freshdesk/view/{{account.id}}/configuration" data-toggle="dropdown">\n                                                              <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONFIGURATION\' | translate }}\n                                                 </a>\n                                          </div>\n                                        </div>\n                                </div>\n                                <div class="portlet-body">\n                                    <!-- START TABLE -->\n                                  <table class="table table-striped table-bordered table-hover">\n                                                  <thead>\n                                                       <tr>\n                                                            <th>{{\'APPLICATION_NAME\' | translate}}</th>\n                                                                     <th>{{\'APPLICATION_DESCRIPTION\' | translate}}</th>\n                                                                  <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n                                                      </tr>\n                                                 </thead>\n                                                    <tbody>\n                                                   <tr data-ng-repeat="configuration in configurations">\n                                                                     <td>{{configuration.name}}</td>\n                                                                       <td>{{configuration.description}}</td>\n                                                      <td>\n                                                                            <a class="btn default btn-xs blue-stripe" data-ng-href="/freshdesk/view/{{account.id}}/configurations/settings/{{configuration.id}}">\n                                                                                 {{ \'APPLICATION_SETTINGS\' | translate}}\n                                                     </a>\n                                                  <a class="btn default btn-xs red-stripe" data-ng-click="deleteConfiguration(configuration.name,configuration.id)">\n                                                                                    {{ \'APPLICATION_DELETE\' | translate }}\n                                                      </a>\n                                                </td>\n                                               </tr>\n                                                             <tr data-ng-hide="configurations.length">\n                                                                     <td colspan="5" style="text-align:center;">\n                                                                           <i>No configuration available</i>\n                                                                     </td>\n                                                         </tr>\n                                           </tbody>\n                                    </table>\n                                      <!-- END TABLE -->\n                            </div>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/freshdesk/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-handbag"></i>\n          <a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n                                     <i class="fa fa-angle-right"></i>\n                             </li>\n                         <li>\n                                  <a href="#">{{account.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 src="assets/images/media/freshdesk.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                                          {{account.name}}\n                                      </div>\n                                        <div class="profile-usertitle-job">\n                                           {{account.remoteUri}}\n                                 </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n                               <!-- SIDEBAR MENU -->\n                         <div class="profile-usermenu">\n                                        <ul class="nav">\n                                              <li data-ng-class="{active: $state.is(\'main.freshdesk.view.account\')}">\n                                                     <a ng-href="/freshdesk/view/{{account.id}}/account">\n                                                  <i class="icon-user"></i>\n                                                     {{ \'APPLICATION_ACCOUNT\' | translate }} </a>\n                                                </li>\n                                         <li data-ng-class="{active: $state.includes(\'main.freshdesk.view.configurations\') || $state.is(\'main.freshdesk.view.configuration\')}">\n                                                    <a ng-href="/freshdesk/view/{{account.id}}/configurations">\n                                                   <i class="icon-settings"></i>\n                                                 {{ \'APPLICATION_CONFIGURATIONS\' | 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/freshdesk/wizard/wizard.html",'<!-- BEGIN PAGE HEADER-->\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-handbag"></i>\n                                          <a href="/freshdesk/list">{{ \'APPLICATION_FRESHDESK\' | translate }}</a>\n                                     </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n<!-- END PAGE HEADER-->\n\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initWizard()">\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-notebook font-green-sharp"></i>\n                                        <span class="caption-subject">{{ \'APPLICATION_ACCOUNT\' | translate }} WIZARD</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body">\n                            <wizard on-finish="createItem()">\n          <wz-step title="{{\'APPLICATION_ACCOUNT_INFO\' | translate}}" canexit="exitValidation(forms.formSetting.$valid)">\n                                                <form name="forms.formSetting" novalidate>\n\n                                                  <!-- START NAME -->\n                                                   <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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.formSetting.name.$invalid && forms.formSetting.$submitted" 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                                                              <input type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="item.description"/>\n                                                       </div>\n                                                        <!-- END DESCRIPTION -->\n\n              <!-- START USERNAME -->\n                                                     <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.username.$invalid}">\n                                                         <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                            <input type="text" name="username" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" class="form-control" data-ng-model="item.username" required ng-remote-validate="/api/freshdesk/accounts/validate/username"/>\n                                                                <span data-ng-show="forms.formSetting.username.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                 <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                               <span data-ng-show="(forms.formSetting.username.$touched || forms.formSetting.$submitted) && forms.formSetting.username.$error.ngRemoteValidate" class="help-block help-block-error">\n                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_USERNAME\' | translate}}.\n                                       </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n\n              <!-- START REMOTE ADDRESS -->\n                                                        <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n                                                                <label class="control-label">{{\'APPLICATION_REMOTE_ADDRESS\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                              <input type="url" name="remoteUri" placeholder="{{\'APPLICATION_REMOTE_ADDRESS\' | translate}}" class="form-control" data-ng-model="item.remoteUri" required ng-remote-validate="/api/freshdesk/accounts/validate/remoteUri"/>\n                                                                <span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                <span data-ng-show="(forms.formSetting.remoteUri.$touched || forms.formSetting.$submitted) && forms.formSetting.remoteUri.$error.ngRemoteValidate" class="help-block help-block-error">\n                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_EXIST_DOMAIN\' | translate}}.\n                                 </span>\n                                                       </div>\n                                                        <!-- END USERNAME -->\n\n              <!-- START API KEY -->\n                                                 <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.apiKey.$invalid}">\n                                                           <label class="control-label">{{\'APPLICATION_API_KEY\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                             <input type="text" name="apiKey" placeholder="{{\'APPLICATION_API_KEY\' | translate}}" class="form-control" data-ng-model="item.apiKey" required/>\n                                                            <span data-ng-show="forms.formSetting.apiKey.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                   <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                         </span>\n                                                       </div>\n                                                        <!-- END API KEY -->\n\n                                                        <input class="btn green-haze" type="submit" value="{{\'APPLICATION_CONTINUE\' | translate}}" data-ng-click="next()"/>\n\n                                               </form>\n                                       </wz-step>\n\n                                  <wz-step title="{{\'APPLICATION_CONFIRM\' | translate}}">\n                                             <p>{{\'MESSAGE_CONFIGURATION_COMPLETED\' | translate}}</p>\n                                            <input class="btn default" type="button" value="{{\'APPLICATION_BACK\' | translate}}" wz-previous/>\n                                           <input type="submit" class="btn green-haze" wz-next value="{{\'APPLICATION_CONFIRM\' | translate}}"/>\n                                 </wz-step>\n\n                          </wizard>\n\n                   </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),
 a.put("app/iframe/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="fa fa-chrome"></i>\n                                  <a href="#" data-ng-if="!Auth.isAgent()">{{ \'APPLICATION_IFRAME\' | translate }}</a>\n                                 <a href="#" data-ng-if="Auth.isAgent()">{{ iframe.title || iframe.name}}</a>\n                          </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN PROFILE SIDEBAR -->\n                <div class="profile-sidebar" data-ng-if="!Auth.isAgent()">\n                    <!-- PORTLET MAIN -->\n                 <div class="portlet light profile-sidebar-portlet">\n                           <!-- SIDEBAR USERPIC -->\n                              <div class="profile-image">\n                                   <img src="assets/images/media/iframe.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                                          {{iframe.title}}\n                                      </div>\n                                        <div class="profile-usertitle-job">\n                                           {{ \'APPLICATION_IFRAME\' | translate }}\n                                      </div>\n                                </div>\n                                <!-- END SIDEBAR USER TITLE -->\n                       </div>\n                        <!-- END PORTLET MAIN -->\n             </div>\n                <!-- END BEGIN PROFILE SIDEBAR -->\n            <!-- BEGIN PROFILE CONTENT -->\n                <div class="profile-content" data-ng-if="!Auth.isAgent()">\n                    <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_IFRAME\' | 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_GENERALS\' | translate}}</a>\n                                                             </li>\n                                                 </ul>\n                                         </div>\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.formSetting" data-ng-submit="forms.formSetting.$valid && updateItem()" novalidate>\n                                                                          <!-- START NAME -->\n                                                                           <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.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="iframe.title" required/>\n                                                                                        <span data-ng-show="forms.formSetting.name.$invalid && forms.formSetting.$submitted" 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 REMOTE ADDRESS -->\n                                                                         <div class="form-group" data-ng-class="{\'has-error\': forms.formSetting.$submitted && forms.formSetting.remoteUri.$invalid}">\n                                                                                        <label class="control-label">{{\'APPLICATION_URL\' | translate}} <span class="required" aria-required="true">*</span></label>\n                                                                                 <input type="url" name="remoteUri" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="iframe.remoteUri" required />\n                                                                                        <span data-ng-show="forms.formSetting.remoteUri.$invalid && forms.formSetting.$submitted" class="help-block help-block-error">\n                                                                                                <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                 </span>\n                                                                               </div>\n                                                                                <!-- END USERNAME -->\n\n                                                                               <input class="btn green-haze" type="submit" value="{{\'APPLICATION_UPDATE\' | translate}}" />\n                                                                 </form>\n                                                               </div>\n                                                                <!-- END GENERAL TAB -->\n\n                                                    </div>\n                                                </div>\n                                        </div>\n                                </div>\n                        </div>\n                </div>\n                <!-- END PROFILE CONTENT -->\n\n                <div class="row" data-ng-if="Auth.isAgent()">\n                 <div class="col-md-12">\n                               <iframe ng-if="url" style="height: 600px" src="{{url}}" />\n                    </div>\n                </div>\n\n      </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/integration/list/list.html",'\n<!-- 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-game-controller"></i>\n                                  <a href="/integrations/list">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a>\n                               </li>\n                 </ul>\n         </div>\n\n              <!-- BEGIN Portlet PORTLET-->\n         <div class="portlet light bordered" data-ng-init="initList()">\n                        <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="icon-eye font-green-sharp"></i>\n                                     <span class="caption-subject">{{ \'APPLICATION_INTEGRATIONS\' | translate }}</a> </span>\n                              </div>\n                                <div class="actions">\n                           <span class="btn green-jungle btn-file">\n            <span> <i class="icon-plus"></i> New App </span>\n            <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n          </span>\n          <a class="btn btn-icon-only btn-default" href="#" ng-csv="displayedIntegrations" filename="integrations.csv">\n                                    <i class="icon-cloud-download"></i></a>\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                          <table st-table="displayedIntegrations" st-safe-src="integrations" class="table table-striped table-bordered table-hover">\n                                    <div class="table-responsive">\n                                          <thead>\n                                                     <tr>\n                                                          <th colspan="6">\n                                                                      <div class="row">\n                                                                             <div class="col-md-6">\n                                                                                        <select class="form-control input-small select2me" data-ng-model="integrationsByPage">\n                                                                                                <option value="10">10</option>\n                                                                                                <option value="25">25</option>\n                                                                                                <option value="50">50</option>\n                                                                                                <option value="{{integrations.length}}">{{ \'APPLICATION_ALL\' | translate }}</option>\n                                                                                        </select>\n                                                                             </div>\n                                                                                <div class="col-md-6">\n                                                                                        <div class="input-group input-medium pull-right">\n                                                                                             <input st-search placeholder="{{ \'APPLICATION_SEARCH\' | translate }}" class="form-control" type="search" />\n                                                                                         <span class="input-group-addon">\n                                                                                                      <i class="fa fa-search"></i>\n                                                                                          </span>\n                                                                                       </div>\n                                                                                </div>\n                                                                        </div>\n                                                                </th>\n                                                 </tr>\n                                           <tr>\n                                                                <th st-sort="id" width="5%" st-sort-default="reverse">{{ \'APPLICATION_ID\' | translate }}</th>\n                                                   <th st-sort="fullname">{{ \'APPLICATION_NAME\' | translate }}</th>\n                                                                <th st-sort="name">{{ \'APPLICATION_FILENAME\' | translate }}</th>\n                                                            <th st-sort="name">{{ \'APPLICATION_VERSION\' | translate }}</th>\n                                                 <th st-sort="name">{{ \'APPLICATION_DESCRIPTION\' | translate }}</th>\n                                                 <th>{{ \'APPLICATION_ACTIONS\' | translate }}</th>\n                                                  </tr>\n                                         </thead>\n                                      <tbody>\n                                         <tr data-ng-repeat="integration in displayedIntegrations">\n                                                                <td>{{integration.id}}</td>\n                                                           <td>{{integration.name}}</td>\n                                                         <td>{{integration.filename}}</td>\n                                                             <td>{{integration.version}}</td>\n                                            <td>{{integration.description}}</td>\n                                                            <td>\n                                                                  <span class="btn default btn-xs blue-stripe btn-file">\n                                            <span> {{ \'APPLICATION_UPDATE\' | translate }} </span>\n                                       <input type="file" accept=".zip" nv-file-select="" uploader="uploader"/>\n                                    </span>\n                                             <a class="btn default btn-xs red-stripe" data-ng-click="deleteItem(integration.name, integration.id)">\n                                                                                {{ \'APPLICATION_DELETE\' | translate }}\n                                              </a>\n                                        </td>\n                                       </tr>\n                                                     <tr data-ng-hide="integrations.length">\n                                                               <td colspan="6" style="text-align:center;">\n                                                                   <i>No integrations available</i>\n                                                              </td>\n                                                 </tr>\n                                   </tbody>\n                                      <tfoot>\n                                                     <tr>\n                                                          <td>\n                                                                  <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="id" class="form-control" type="search"/>\n                                                                    </div>\n                                                    </td>\n                                                 <td>\n                                                                      <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="name" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_NAME\' | translate | lowercase}}" class="form-control" type="search"/>\n                                                                        </div>\n                                                    </td>\n                                                 <td>\n                                                                      <div class="input-icon right">\n                                                                                <i class="fa fa-search"></i>\n                                                                          <input st-search="filename" placeholder="{{ \'APPLICATION_SEARCH\' | translate }} {{ \'APPLICATION_BY\' | translate | lowercase }} {{ \'APPLICATION_FILENAME\' | translate | lowercase}}" class="form-control" type="search"/>\n                                                                        </div>\n                                                    </td>\n                                                             <td>\n                                              </td>\n                                                             <td>\n                                              </td>\n                                                             <td>\n                                              </td>\n                                               </tr>\n                                           <tr>\n                                            <td colspan="6" class="text-center">\n                                            <div st-pagination class="pagination" st-items-by-page="integrationsByPage" st-displayed-pages="7"></div>\n                                           </td>\n                                       </tr>\n                                       </tfoot>\n                            </div>\n                                </table>\n                              <!-- END TABLE -->\n                    </div>\n                </div>\n                <!-- END Portlet PORTLET-->\n   </div>\n</div>\n<!-- END PAGE CONTENT-->\n'),a.put("app/jscripty/project/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_PROJECT\' | 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" required/>\n      <span data-ng-show="(form.name.$touched || form.$submitted) && form.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  </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/jscripty/project/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-slack"></i>\n          <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | 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-docs font-green-sharp"></i>\n                                    <span class="caption-subject">{{ \'APPLICATION_PROJECTS\' | translate }}</a> </span>\n                          </div>\n                                <div class="actions" ng-show="isAdmin">\n                                       <div class="btn-group">\n                                               <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();">\n                                                   <i class="icon-reload"></i>\n                                           </a>\n                                  </div>\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                                               <a class="btn green-jungle" ng-click="createItem()">\n                                                  <i class="icon-plus"></i> {{ \'APPLICATION_NEW_PROJECT\' | 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\n                                        <!-- <div class="table-responsive"> -->\n\n\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\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/jscripty/project/report/report.detail.html",'<div class="portlet light bordered" data-ng-init="getProjectDetail();initView()">\n<div class="portlet-title">\n<div class="caption font-green-sharp">\n<i class="fa fa-list font-green-sharp"></i>\n<span class="caption-subject">{{ \'APPLICATION_SUMMARY\' | translate }}</a> </span>\n</div>\n<div class="actions">\n <div class="btn-group">\n <button class="btn btn-icon-only btn-primary"  data-ng-click="pdf(\'header\',projectDetail)">\n         <i class="fa fa-download"></i>\n </button>\n <!-- <button class="btn btn-icon-only btn-default"  data-ng-click="accordion.expandAll()">\n       <i class="fa fa-folder-open-o"></i>\n </button>\n <button class="btn btn-icon-only btn-default"  data-ng-click="accordion.collapseAll()">\n     <i class="fa fa-folder"></i>\n </button> -->\n </div>\n</div>\n</div>\n<div id=\'detail\' class="portlet-body">\n      <div class="alert alert-success text-center" ng-show="!projectDetail.length">\n                 <h4>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</h4>\n   </div>\n        <div class="row" ng-show="projectDetail.length">\n              <div class="col-md-10 col-md-offset-1">\n                       <div id="header" class="panel panel-info">\n                            <div  class="panel-heading">\n                                  <strong>Project Name:    </strong>{{project.name}}<br>\n                                        <strong>Project Id:      </strong>{{project.id}}<br>\n                                  <strong>Completed:       </strong>{{projectStats.completed}}<br>\n                                      <strong>Incomplete:      </strong>{{projectStats.incomplete}}<br>\n                                     <strong>% Completed:     </strong>{{projectStats.completed * 100 /(projectStats.completed + projectStats.incomplete) | number:2}}<br>\n                         </div>\n                        </div><br>\n                    <v-accordion class="vAccordion--default" multiple control="accordion">\n                                <v-pane id="{{question.question_id }}" ng-repeat="question in projectDetail" expanded="true">\n                                 <v-pane-header>\n                                       Question Id:    {{question.question_id}}\n                              </v-pane-header>\n                              <v-pane-content>\n                                              <div ng-class=" {{question.graphData.length > 0}} ? \'col-md-8\' : \'col-md-12\'">\n                                                    <div class="row">\n                                                             <div class="col-md-10 col-md-offset-1 ">\n                                                                      <h4><strong>{{question.question_label}}</strong> : {{question.question_text}}</h4>\n                                                                    <br><br>\n                                                                      <table ng-if="question.choices.length" class="table  table-hover"  style="table-layout: fixed; width: 100%">\n                                                                          <thead>\n                                                                                       <tr>\n                                                                                          <th>Response</th>\n                                                                                             <th> #Response </th>\n                                                                                          <th> % </th>\n                                                                                  </tr>\n                                                                         </thead>\n                                                                              <tbody>\n                                                                                       <tr ng-if="!choice.other_option" ng-repeat="choice in question.choices ">\n                                                                                                                     <td  style="word-wrap: break-word">{{choice.value}}</td>\n                                                                                                                      <td>{{choice.count}}</td>\n                                                                                                                     <td>{{choice.percentage | number:2}}</td>\n                                                                                     </tr>\n                                                                         </tbody>\n                                                                      </table>\n                                                              </div>\n                                                        </div>\n                                                <div class="row" ng-if="question.question_other_label">\n                                               <!-- <div class="row" ng-if="choice.other_option" ng-repeat="choice in question.choices "> -->\n                                                        <!-- <div class="col-md-10 col-md-offset-1 ">\n                                                         <strong>{{choice.value}}</strong> <span class="badge">{{choice.count}}</span><br>\n                                                     </div> -->\n                                                    <!-- accordions can be nested :) -->\n                                                  <v-accordion >\n                                                                <v-pane >\n                                                                     <!-- ng-repeat="subpane in pane.subpanes" ng-disabled="subpane.isDisabled" -->\n                                                                        <v-pane-header>\n                                                                               <strong>{{question.question_other_label}}</strong><br>\n                                                                        </v-pane-header>\n                                                                      <v-pane-content>\n                                                                              <table ng-if="question.choices.length" class="table  table-hover"  style="table-layout: fixed; width: 100%">\n                                                                                  <thead>\n                                                                                               <tr>\n                                                                                                  <th>Response</th>\n                                                                                                     <th> #Response </th>\n                                                                                                  <!-- <th> % </th> -->\n                                                                                         </tr>\n                                                                                 </thead>\n                                                                                      <tbody>\n\n                                                                                             <tr ng-if="choice.other_option" ng-repeat="choice in question.choices ">\n                                                                                                                              <td  style="word-wrap: break-word">{{choice.value}}</td>\n                                                                                                                              <td>{{choice.count}}</td>\n                                                                                                                             <!-- <td>{{choice.percentage | number:2}}</td> -->\n                                                                                            </tr>\n                                                                                 </tbody>\n                                                                              </table>\n                                                                      </v-pane-content>\n                                                             </v-pane>\n                                                     </v-accordion>\n                                                </div>\n                                                <div class="row">\n                                                     <div class="col-md-10 col-md-offset-1 ">\n                                                      <h4>    <strong>Total Respondents: {{question.total}}</strong></h4><br>\n                                                       </div>\n                                                </div>\n                                                </div>\n                                                <div class=" col-md-4 pull-right " ng-if="question.graphType == \'bar\' && question.graphData">\n                                               <canvas  class="chart chart-bar"  chart-data="question.graphData" chart-labels="question.graphLabels" chart-legend="true">\n                                            </canvas>\n                                             </div>\n                                                <div class="col-md-4 pull-right " ng-if="question.graphType == \'pie\'  && question.graphData">\n                                               <canvas  class="chart chart-pie"  chart-data="question.graphData" chart-labels="question.graphLabels" chart-legend="true">\n                                            </canvas>\n                                             </div>\n                                        </v-pane-content>\n                             </v-pane>\n                     </v-accordion>\n                        </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/jscripty/project/report/report.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="fa fa-edit"></i>\n                                            <a href="/jscripty/projects/list">{{ \'APPLICATION_JSCRIPTY\' | translate }}</a>\n                                              <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="fa fa-slack"></i>\n                                           <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n                                       </li>\n                                 <li>\n                                          <i class="icon-book-open"></i>\n                                                <a href="">{{ \'APPLICATION_REPORTS\' | translate }}</a>\n                                      </li>\n                         </ul>\n                 </div>\n                </div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n                               <div class="col-md-12">\n\n                             <!-- BEGIN PROFILE SIDEBAR -->\n                                        <div class="profile-sidebar">\n               <div class="portlet light profile-sidebar-portlet">\n                                                                             <!-- SIDEBAR USERPIC -->\n                                                                              <div class="profile-image">\n                                                                                           <img src="assets/images/media/report.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                                                                                                  {{project.name}}[{{project.id}}]\n                                                                                              </div>\n                                                                                                <div class="profile-usertitle-job">\n\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.jscripty.projects.report.sessions\')|| $state.is(\'main.jscripty.projects.report.sessionDetail\')}">\n                                                                                                                                     <a data-ng-href=\'/jscripty/projects/report/{{projectId}}/sessions\'>\n                                                                 <i class="icon-settings"></i>\n                                                                 Sessions</a>\n                                                                                                          </li>\n                                                         <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.summary\') || $state.is( \'main.jscripty.projects.report.questionDetail\')}">\n                                                                                                                           <a data-ng-href=\'/jscripty/projects/report/{{projectId}}/summary\'>\n                                                                                          <i class="fa fa-bar-chart"></i>\n                                                                     Questions</a>\n                                                           </li>\n                                                         <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.detail\')}">\n                                                                                                                            <a data-ng-href=\'/jscripty/projects/report/{{projectId}}/detail\'>\n                                                                                                           <i class="fa fa-list"></i>\n                                                                  Summary</a>\n                                                             </li>\n                                                         <li data-ng-class="{active: $state.is(\'main.jscripty.projects.report.inputs\')}">\n                                                                                                                            <a data-ng-href=\'/jscripty/projects/report/{{projectId}}/inputs\'>\n                                                                                                           <i class="fa fa-edit"></i>\n                                                                  Inputs</a>\n                                                              </li>\n                                                                                                 </ul>\n                                                                         </div>\n                                                                                <!-- END MENU -->\n\n                   </div>\n\n              </div>\n\n              <div class="profile-content margin-top-20">\n                                                                   <div class="row">\n                                                                             <div class="col-md-12">\n                                                                                                               <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n                                                                                                                    <div class="dashboard-stat2">\n                                                                                                                         <div class="display">\n                                                                                                                                 <div class="number">\n                                                                                                                                          <h3 class="font-green-sharp">{{projectStats.started}}</h3>\n                                                                                                                                            <small>Started</small>\n                                                                                                                                        </div>\n                                                                                                                                        <div class="icon">\n                                                                                                                                            <i class="icon-pie-chart"></i>\n                                                                                                                                        </div>\n                                                                                                                                </div>\n                                                                                                                                <div class="progress-info">\n                                                                                                                                   <div class="progress">\n                                                                                                                                                <span style="width: 100%;" class="progress-bar progress-bar-success green-sharp">\n                                                                                                                                             </span>\n                                                                                                                                       </div>\n                                                                                                                                        <div class="status">\n                                                                                                                                  </div>\n                                                                                                                                </div>\n                                                                                                                        </div>\n                                                                                                                </div>\n                                                                                                                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n                                                                                                                    <div class="dashboard-stat2">\n                                                                                                                         <div class="display">\n                                                                                                                                 <div class="number">\n                                                                                                                                          <h3 class="font-red-haze">{{projectStats.incomplete}}</h3>\n                                                                                                                                            <small>Incomplete</small>\n                                                                                                                                     </div>\n                                                                                                                                        <div class="icon">\n                                                                                                                                            <i class="icon-chart"></i>\n                                                                                                                                    </div>\n                                                                                                                                </div>\n                                                                                                                                <div class="progress-info">\n                                                                                                                                   <div class="progress">\n                                                                                                                                                <span style="width: 100%;" class="progress-bar progress-bar-success red-haze">\n                                                                                                                                                </span>\n                                                                                                                                       </div>\n                                                                                                                                        <div class="status">\n                                                                                                                                  </div>\n                                                                                                                                </div>\n                                                                                                                        </div>\n                                                                                                                </div>\n                                                                                                                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">\n                                                                                                                    <div class="dashboard-stat2">\n                                                                                                                         <div class="display">\n                                                                                                                                 <div class="number">\n                                                                                                                                          <h3 class="font-blue-sharp">{{projectStats.completed}}</h3>\n                                                                                                                                           <small>Completed</small>\n                                                                                                                                      </div>\n                                                                                                                                        <div class="icon">\n                                                                                                                                            <i class="icon-like"></i>\n                                                                                                                                     </div>\n                                                                                                                                </div>\n                                                                                                                                <div class="progress-info">\n                                                                                                                                   <div class="progress">\n                                                                                                                                                <span style="width: 100%;" class="progress-bar progress-bar-success blue-sharp">\n                                                                                                                                              </span>\n                                                                                                                                       </div>\n                                                                                                                                        <div class="status">\n                                                                                                                                  </div>\n                                                                                                                                </div>\n                                                                                                                        </div>\n                                                                                                                </div>\n                                                                                        </div>\n                                                        </div>\n\n                      <div class="row">\n                       <div ui-view class="col-md-12">\n                       </div>\n                        </div>\n              </div>\n        </div>\n        </div>\n'),a.put("app/jscripty/project/report/report.inputs.html",'<div class="row">\n  <div class="col-md-12">\n                               <div class="portlet light bordered" data-ng-init="getQuestionInputs()">\n                                                                       <div class="portlet-title">\n                                                                           <div class="caption font-green-sharp">\n                                                                                        <i class="fa fa-edit font-green-sharp"></i>\n                                                                                   <span class="caption-subject">{{ \'APPLICATION_INPUTS\' | translate }}</a> </span>\n                                                                            </div>\n                                                                        <div class="tools">\n                                                                                   <!-- <a href="" class="fullscreen" data-original-title="" title="">\n                                                                                   </a> -->\n                                                                              </div>\n                                                                        </div>\n                                                                        <div class="portlet-body" >\n                                                                           <div ui-grid="gridOptions" 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                                                                        </div>\n                        </div>\n        </div>\n</div>\n'),a.put("app/jscripty/project/report/report.question.detail.html",'<div class="row" data-ng-init="getDetail()">\n      <div class="col-md-12">\n               <div class="portlet light bordered">\n                  <div class="portlet-title">\n                           <div class="caption font-green-sharp">\n                                        <i class="fa fa-list font-green-sharp"></i>\n                                   <span class="caption-subject">{{ \'APPLICATION_DETAIL\' | translate }}</a> </span>\n                            </div>\n                        </div>\n                        <div class="portlet-body" >\n                           <div class="alert alert-success text-center" ng-show="!questionDetail">\n                                               <h4>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</h4>\n                           </div>\n                                <div class="row  margin-top-20" ng-show="questionDetail">\n                                     <div class="col-md-10 col-md-offset-1">\n                                               <div class="panel panel-info" >\n                                                       <div class="panel-heading">\n                                                           <h3 class="panel-title">\n\n                                                                    <i class="fa-chart "></i>Question Id:   {{questionDetail.question_id}}\n                                                        </div>\n                                                        <div class="panel-body">\n                                                              <div class="row">\n                                                                     <div class="col-md-12">\n                                                                               <h4><strong>{{questionDetail.question_label}}</strong></h4>\n                                                                   </div>\n                                                                </div>\n                                                                <div class="row">\n                                                                     <div class="col-md-10 col-md-offset-1 ">\n                                                                              <strong><h4>{{questionDetail.question_text}}</h4></strong><br>\n                                                                        </div>\n                                                                </div>\n                                                                <div class="row">\n                                                                     <div class="col-md-6">\n                                                                                <div class="row">\n                                                                                     <div class="col-md-10 col-md-offset-1 ">\n                                                                                              <!-- <div class="alert alert-success text-center" ng-show="!questionDetail.choices.length">\n                                                                                                           <h4>{{ \'MESSAGE_NO_RESULTS_AVAILABLE\' | translate }}</h4>\n                                                                                           </div> -->\n                                                                                            <table ng-if="questionDetail.choices.length" class="table  table-hover" style="table-layout: fixed; width: 100%">\n                                                                                                     <thead>\n                                                                                                               <tr>\n                                                                                                                  <th style="width=5%"> Value  </th>\n                                                                                                                    <th style="width=5%"> Count </th>\n                                                                                                                     <th ng-if="question.graphType != \'PolarArea\'" style="width=5%"> % </th>\n                                                                                                             </tr>\n                                                                                                 </thead>\n                                                                                                      <tbody>\n                                                                                                               <tr ng-if="!choice.other_option" ng-repeat="choice in questionDetail.choices ">\n                                                                                                                                               <td style="word-wrap: break-word">{{choice.value}}</td>\n                                                                                                                                               <td>{{choice.count}}</td>\n                                                                                                                                             <td ng-if="question.graphType != \'PolarArea\'">{{choice.percentage | number:2}}</td>\n                                                                                                         </tr>\n                                                                                                 </tbody>\n                                                                                              </table>\n                                                                              </div>\n                                                                                </div>\n                                                                        <div class="row" ng-if="choice.other_option" ng-repeat="choice in questionDetail.choices ">\n                                                                           <div class="col-md-6 col-md-offset-3 ">\n                                                                                       <strong><a href="">{{choice.value}}</a> </strong> <span class="badge">{{choice.count}}</span><br>\n\n                                                                           </div>\n                                                                        </div>\n                                                                        <div class="row">\n                                                                             <div class="col-md-10 col-md-offset-1 ">\n                                                                              <h4>    <strong>Total: {{questionDetail.total}}</strong></h4><br>\n                                                                             </div>\n                                                                        </div>\n                                                                        </div>\n                                                                        <div class="col-md-6 pull-right ">\n                                                                            <canvas id="base" class="chart-base" chart-type="questionDetail.graphType"\n                                                                            chart-data="questionDetail.graphData" chart-labels="questionDetail.graphLabels" chart-legend="true">\n                                                                          </canvas>\n                                                                             <!-- <button class="btn btn-success btn-sm pull-right" ng-click="toggle(questionDetail)">{{questionDetail.graphType}}</button> -->\n                                                                    </div>\n                                                                </div>\n\n                                      </div>\n\n                              </div>\n\n                      </div>\n                </div>\n\n                      </div>\n                        </div>\n                </div>\n</div>\n'),a.put("app/jscripty/project/report/report.session.detail.html",'\n\n<div class="row" data-ng-init="getSessionDetails()">\n                   <div class="col-md-12">\n                               <div class="portlet light bordered">\n                                  <div class="portlet-title">\n                                           <div class="caption font-green-sharp">\n                                                        <i class="fa fa-list font-green-sharp"></i>\n                                                   <span class="caption-subject">{{ \'APPLICATION_DETAIL\' | translate }}</a> </span>\n                                            </div>\n            <div class="actions">\n             <div class="btn-group">\n               <button class="btn btn-icon-only btn-primary"  data-ng-click="pdf(\'header\',sessionQuestions)">\n                 <i class="fa fa-download"></i>\n               </button>\n               <!-- <button class="btn btn-icon-only btn-default"  data-ng-click="accordion.expandAll()">\n                 <i class="fa fa-plus-square-o"></i>\n               </button>\n               <button class="btn btn-icon-only btn-default"  data-ng-click="accordion.collapseAll()">\n                 <i class="icon-collapse-alt"></i>\n               </button> -->\n             </div>\n           </div>\n                                      </div>\n                                        <div class="portlet-body"  style="height: auto;">\n                                             <div class="row  margin-top-20">\n                                                      <div class="col-md-10 col-md-offset-1">\n                                                               <div id = "header" class="panel panel-info">\n                                                                  <div class="panel-heading">\n                                                                           <strong>Project Name:    </strong>{{project.name}}<br>\n                                                                                <strong>Project Id:      </strong>{{project.id}}<br>\n                                                                          <strong>Session Id:      </strong>{{session.session_id}}<br>\n                                                                          <strong>Status:  </strong>{{session.status}}<br>\n                                                                              <strong>Started At:      </strong>{{session.createdAt}}<br>\n                                                                           <strong>Closed At:       </strong>{{session.completedAt}}<br>\n                                                                 </div>\n                                                                </div>\n                <v-accordion class="vAccordion--default" multiple control="accordion">\n                  <v-pane id="{{question.question_id }}" ng-repeat=" question in sessionQuestions | orderBy:\'index\'"" expanded="true">\n                    <v-pane-header>\n                      Question Id:       {{question.question_id}}\n                    </v-pane-header>\n                    <v-pane-content>\n                        <h4><strong>{{question.question_label}}</strong> : {{question.question_text}}</h4>\n                        <div ng-if="question.question_type == \'question\'">\n                        <h4><strong>Answer:      </strong>{{question.question_answer}}</h4>\n                      </div>\n                      <div ng-if="question.question_other_label">\n                        <h4>\n                       <strong>{{question.question_other_label}}: </strong>\n                         {{question.question_other_answer || \'No Value\'}}\n                       </h4>\n                      </div>\n                      <table class="table  table-hover" ng-if="question.ReportJscriptyInputs.length">\n                        <thead>\n                          <tr>\n                            <th > Label </th>\n                            <th >Answer </th>\n                          </tr>\n                        </thead>\n                        <tbody>\n                          <tr ng-repeat="input in question.ReportJscriptyInputs |orderBy:\'id\'">\n                                  <td>{{input.input_label}}</td>\n                                  <td>{{input.input_value || \'No Value\'}}</td>\n                          </tr>\n                        </tbody>\n                      </table>\n                    </v-pane-content>\n                  </v-pane>\n                </v-accordion>\n                                                              </div>\n                                                        </div>\n                </div>\n                                </div>\n                </div>\n</div>\n'),
-a.put("app/jscripty/project/report/report.sessions.html",'\n   <div class="row" >\n            <div class="col-md-12">\n                       <div class="portlet light bordered" data-ng-init="getProjectSessions()">\n                                                              <div class="portlet-title">\n                                                                   <div class="caption font-green-sharp">\n                                                                                <i class="icon-settings font-green-sharp"></i>\n                                                                                <span class="caption-subject">{{ \'APPLICATION_SESSIONS\' | translate }}</a> </span>\n                                                                  </div>\n                                                                        <div class="actions">\n                                                                         <div class="btn-group">\n                                                                                       <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();initView()">\n                                                                                         <i class="icon-reload"></i>\n                                                                                   </a>\n                                                                          </div>\n                                                                        </div>\n                                                                </div>\n                                                                <div class="portlet-body" >\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                                                        </div>\n                                </div>\n                        </div>\n        </div>\n'),a.put("app/jscripty/project/report/report.summary.html",'<div class="row">\n <div class="col-md-12">\n               <div class="portlet light bordered" data-ng-init="getQuestionSummary()">\n                                                      <div class="portlet-title">\n                                                           <div class="caption font-green-sharp">\n                                                                        <i class="fa fa-bar-chart font-green-sharp"></i>\n                                                                      <span class="caption-subject">{{ \'APPLICATION_QUESTIONS\' | translate }}</a> </span>\n                                                         </div>\n                                                                <div class="actions">\n                                                                 <div class="btn-group">\n                                                                               <!-- <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();initView()">\n                                                                                    <i class="icon-reload"></i>\n                                                                           </a> -->\n                                                                      </div>\n                                                                </div>\n                                                        </div>\n                                                        <div class="portlet-body" >\n                                                                           <div ui-grid="gridOptions" 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                                                        </div>\n                                </div>\n        </div>\n</div>\n'),a.put("app/jscripty/project/view/view.html",'<div class="row" data-ng-init="getProject()">\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-edit"></i>\n                                            <a href="/jscripty/projects/list">{{ \'APPLICATION_JSCRIPTY\' | translate }}</a>\n                                              <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="fa fa-slack"></i>\n                                           <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n                                       </li>\n          <li>\n                                         <a ng-href="/jscripty/projects/view/{{jscriptyProject.id}}">{{jscriptyProject.name}}</a>\n          </li>\n                             </ul>\n                 </div>\n                </div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n              <div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/landing/landing.html",'<!-- BEGIN LOGO -->\n<div class="logo">\n  <a href="index.html">\n    <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big.png" alt="logo" />\n    <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big\'}}" alt="logo" class="custom-login-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big.png\';"/>\n  </a>\n</div>\n<!-- END LOGO -->\n\n<!-- BEGIN LANDING -->\n<div data-ng-init="initLanding()">\n  <div data-ng-show="message" class="col-md-12 page-500" style="padding-bottom: 50px;">\n    <div class="number">\n      Oops!\n    </div>\n    <div class=" details" style="color: white;">\n      <h3>{{message | translate}}.</h3>\n      <p>\n        Please contact your administrator.<br><br>\n      </p>\n    </div>\n  </div>\n</div>\n<!-- END LANDING -->\n\n<div class="copyright">\n  xCALLY Motion v. {{info.version}} | 2016 - {{year + 1}} &copy; Powered by Xenialab <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="\'| \'+settings.footerWhiteLabel"></ng-bind-html>\n</div>\n'),a.put("app/login/login.html",'<!-- BEGIN LOGO -->\n<div class="logo" data-ng-init="getInfo()">\n       <a>\n           <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big.png" alt="logo" />\n              <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big.png\'}}" alt="logo" class="custom-login-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big.png\';"/>\n    </a>\n</div>\n<!-- END LOGO -->\n<!-- BEGIN LOGIN -->\n<div class="content">\n  <!-- BEGIN LOGIN FORM -->\n     <form class="login-form" name="loginForm" data-ng-if="!forgotPassword" data-ng-submit="login(loginForm)" novalidate>\n          <h3 class="form-title">Sign In</h3>\n           <div class="alert alert-success" data-ng-show="recovered">\n                    <button class="close" data-close="alert"></button>\n                    <span>{{\'MESSAGE_ACCOUNT_RECOVERED\' | translate}}</span>\n            </div>\n                <div class="alert alert-danger" data-ng-class="{\'display-hide\': !loginForm.$submitted || !errorLogin}">\n                     <button class="close" data-close="alert"></button>\n                    <span>{{ errorLog ? errorLog : (\'MESSAGE_INSERT_USER_OR_PASS\' | translate)}}</span>\n         </div>\n                <div class="form-group" data-ng-class="{\'has-error\': loginForm.$submitted && loginForm.name.$invalid}">\n                     <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}</label>\n                 <div class="input-icon">\n                              <i class="fa fa-user"></i>\n                            <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" name="name" ng-model="userLogin.name" required/>\n                  </div>\n                        <span data-ng-show="loginForm.$submitted && loginForm.name.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n             </div>\n                <div class="form-group" data-ng-class="{\'has-error\': loginForm.$submitted && loginForm.password.$invalid}">\n                 <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}</label>\n                 <div class="input-icon">\n                              <i class="fa fa-lock"></i>\n                            <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" name="password" ng-model="userLogin.password" required/>\n                      </div>\n                        <span data-ng-show="loginForm.$submitted && loginForm.password.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n                 <span class="help-block"><a href="#" data-ng-click="toggleForgotPassword(true)" class="forget-password">{{\'APPLICATION_FORGOT_PASSWORD\' | translate}}?</a></span>\n           </div>\n                <div class="form-actions">\n                    <button type="submit" class="btn btn-success uppercase">{{\'APPLICATION_LOGIN\' | translate}}</button>\n                        <label class="rememberme check">\n                              <input type="checkbox" data-ng-model="userLogin.remember"> {{\'APPLICATION_REMEMBER_ME\' | translate}}\n                        </label>\n                      <!-- <label class="rememberme check">\n                 <input type="checkbox" name="remember" value="1"/>Remember </label> -->\n                       <!-- <a href="javascript:;" id="forget-password" class="forget-password">Forgot Password?</a> -->\n             </div>\n        </form>\n       <form name="forgetForm" data-ng-if="forgotPassword" data-ng-submit="forgetForm.$valid && recover()" novalidate>\n               <h3>{{\'APPLICATION_FORGOT_PASSWORD\' | translate}}?</h3>\n             <p>\n                   {{\'APPLICATION_INSERT_EMAIL_TO_RESET\' | translate}}\n         </p>\n          <div class="alert alert-success" data-ng-show="showRecoverMessage">\n                   <button class="close" data-close="alert"></button>\n                    <span>{{\'MESSAGE_CHECK_YOUR_EMAIL_RECOVER\' | translate}}</span>\n             </div>\n                <div class="form-group" data-ng-class="{\'has-error\': forgetForm.$submitted && forgetForm.email.$invalid}">\n                  <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                    <div class="input-icon">\n                              <i class="fa fa-envelope"></i>\n                                <input class="form-control form-control-solid placeholder-no-fix" type="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" name="email" ng-model="userLogin.email" required/>\n                 </div>\n                        <span data-ng-show="forgetForm.$submitted && forgetForm.email.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n          </div>\n                <div class="form-actions">\n                    <button type="button" id="back-btn" data-ng-click="toggleForgotPassword(false)" class="btn btn-default">{{\'APPLICATION_BACK\' | translate}}</button>\n                 <button type="submit" class="btn btn-success uppercase pull-right">{{\'APPLICATION_SUBMIT\' | translate}}</button>\n            </div>\n        </form>\n               <div class="login-options">\n                   <h4>{{\'APPLICATION_FOLLOW_US\' | translate}}</h4>\n                    <ul class="social-icons">\n                             <li>\n                <a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xcallymotion" target="_blank"></a>\n              </li>\n                 <li>\n                    <a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xcallymotion" target="_blank"></a>\n             </li>\n                 <li>\n                    <a class="social-icon-color googleplus" data-original-title="Google Plus" href="https://plus.google.com/+Xcally" target="_blank"></a>\n               </li>\n                 <li>\n                    <a class="social-icon-color linkedin" data-original-title="Linkedin" href="https://www.linkedin.com/company/xcally" target="_blank"></a>\n                    </li>\n                     </ul>\n         </div>\n</div>\n<div class="copyright">\n       xCALLY Motion v. {{info.version}} | 2016 - {{year + 1}} &copy; Powered by Xenialab <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="\'| \'+settings.footerWhiteLabel"></ng-bind-html>\n</div>\n<!-- END LOGIN -->\n'),a.put("app/main/about.modal.html",'<div class="center-text">\n<div class="modal-header no-border">\n<button type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <!-- <h3 class="modal-title center-text">{{ \'APPLICATION_ABOUT\' | translate }}</h3> -->\n</div>\n<div class="modal-body" style="padding-top:0px;">\n  <div  class="mbottom20" data-ng-init="getInfo()">\n    <a>\n           <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big-pdf.png" alt="logo" class="about-logo" />\n               <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big-pdf.png\'}}" alt="logo" class="custom-login-logo about-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big-pdf.png\';"/>\n </a>\n</div>\n<div class="mbottom20">\n  <b class="sounds-title-icon">xCALLY Motion</b><br>\n  <small>v. {{info.version}}</small><br><br>\n  <small>2016 - {{year + 1}} &copy; Powered by Xenialab</small><br>\n  <small><a href="https://www.xcallymotion.com">www.xcallymotion.com</a></small><br>\n  <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="settings.footerWhiteLabel"></ng-bind-html>\n</div>\n<div class="mbottom20">\n  <span><b>{{\'APPLICATION_USEFUL_LINKS\' | translate}}</b></span><br>\n  <small><a href="https://wiki.xcallymotion.com/" target="_blank">Wiki</a></small><br>\n  <small><a href="http://www.xcally.com/bar/multichannel/Setup.msi" target="_blank">Phonebar Download</a></small><br>\n  <small><a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></small><br>\n</div>\n  <div class="login-options" style=\'margin-bottom:0px;\'>\n  <h4>{{\'APPLICATION_FOLLOW_US\' | translate}}</h4>\n  <ul class="social-icons">\n    <li>\n      <a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xcallymotion" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xcallymotion" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color googleplus" data-original-title="Google Plus" href="https://plus.google.com/+Xcally" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color linkedin" data-original-title="Linkedin" href="https://www.linkedin.com/company/xcally" target="_blank"></a>\n    </li>\n  </ul>\n</div>\n<div class="login-options" style=\'margin-bottom:0px;\'>\n<h4>{{\'APPLICATION_CONTACT_US\' | translate}}:</h4>\n<div class="float-right" style="margin-top:10px;margin-bottom:10px;">\n  <a href="mailto:support@xcally.com">support@xcally.com</a></small>\n</div>\n</div>\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/main/audioFileDownload.play.modal.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" style="text-align:center;">\n  <audio controls autoplay ng-src="{{audio}}" preload="none">\n    Your browser does not support the audio tag.</audio>\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/main/chooseContact.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_CHOOSE_CONTACT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <table st-table="rowCollection" class="table table-striped">\n      <tbody>\n       <tr ng-repeat="contact in contacts">\n                  <td>{{contact.firstName}} {{contact.lastName || \'\'}}</td>\n           <td>{{contact.List.name}}</td>\n                <td>\n        <button class="btn default btn-xs green-stripe" data-ng-click="open(contact)">\n          {{ \'APPLICATION_OPEN\' | translate}}\n        </button>\n      </td>\n         </tr>\n    <tr data-ng-hide="contacts.length">\n      <td colspan="3" style="text-align:center;">\n        <i>{{ \'MESSAGE_NO_CONTACTS_AVAILABLE\' | translate }}</i>\n      </td>\n    </tr>\n         </tbody>\n  </table>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="open()"><i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p>{{\'MESSAGE_CLOSE_EDITED_TAB\' | translate}}</p>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.jscripty.html",' <div class="modal-header" data-ng-init="init()">\n  <h3  class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n  <!-- <h3   ng-if="projectStatus == \'incomplete\'" class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3> -->\n\n</div>\n<div   class="modal-body">\n<!-- <div  ng-if="projectStatus == \'incomplete\'" class="modal-body"> -->\n  <p>{{\'MESSAGE_CLOSE_INCOMPLETE\' | translate}}</p>\n</div>\n\n\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/cm.disposition.modal.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  <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()"  data-ng-disabled="!item.disposition">{{ \'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/main/company.info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_COMPANY_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="row">\n     <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\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                                         <li>\n                                                  <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADDRESS\' | translate}}</a>\n                                     </li>\n                                         <li>\n                                                  <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_SHIPMENT_ADDRESS\' | 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 && updateCompany()" novalidate>\n                                                       <div class="row">\n                                                             <div class="col-md-6">\n                                                                        <!-- START NAME -->\n                                                                   <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_NAME\' | translate}}</label>\n                                                                             <input readonly type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="company.name" required/>\n                                                                       </div>\n                                                                        <!-- END NAME -->\n\n                                                                   <!-- START VAT -->\n                                                                    <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_VAT\' | translate}}</label>\n                                                                              <input readonly type="text" name="vat" placeholder="{{\'APPLICATION_VAT\' | translate}}" class="form-control" data-ng-model="company.vat"/>\n                                                                   </div>\n                                                                        <!-- END VAT -->\n\n                                                                    <!-- START COMPANYID -->\n                                                                      <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_COMPANY_ID\' | translate}}</label>\n                                                                               <input readonly type="text" name="companyId" placeholder="{{\'APPLICATION_COMPANY_ID\' | translate}}" class="form-control" data-ng-model="company.companyId"/>\n                                                                        </div>\n                                                                        <!-- END COMPANYID -->\n\n                                                                      <!-- START WEBSITE -->\n                                                                        <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_WEBSITE\' | translate}}</label>\n                                                                                  <input readonly type="text" name="website" placeholder="{{\'APPLICATION_WEBSITE\' | translate}}" class="form-control" data-ng-model="company.website"/>\n                                                                       </div>\n                                                                        <!-- END WEBSITE -->\n\n                                                                        <!-- START EMAIL -->\n                                                                          <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                                                                            <input readonly type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="company.email"/>\n                                                                    </div>\n                                                                        <!-- END EMAIL -->\n                                                            </div>\n                                                                <div class="col-md-6">\n                                                                        <!-- START PHONE -->\n                                                                          <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                                                                            <input readonly type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="company.phone"/>\n                                                                     </div>\n                                                                        <!-- END PHONE -->\n\n                                                                          <!-- START FAX -->\n                                                                    <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                                                                              <input readonly type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="company.fax"/>\n                                                                   </div>\n                                                                        <!-- END FAX -->\n\n                                                                    <!-- START TYPE -->\n                                                                   <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                             <input readonly type="text" name="type" placeholder="{{\'APPLICATION_TYPE\' | translate}}" class="form-control" data-ng-model="company.type"/>\n                                                                        </div>\n                                                                        <!-- END TYPE -->\n\n                                                                   <!-- START DESCRIPTION -->\n                                                                    <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                                                              <textarea readonly type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="company.description"></textarea>\n                                                                      </div>\n                                                                        <!-- END DESCRIPTION -->\n                                                              </div>\n                                                        </div>\n                                                </form>\n                                       </div>\n                                        <!-- END ADVANCED TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.address" novalidate>\n                                                        <!-- START STREET -->\n                                                         <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                                                           <input readonly type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.street"/>\n                                                          </div>\n                                                        <!-- END STREET -->\n\n                                                         <!-- START POSTALCODE -->\n                                                     <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                                                               <input readonly type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.postalCode"/>\n                                                      </div>\n                                                        <!-- END POSTALCODE -->\n\n                                                     <!-- START CITY -->\n                                                   <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                                                             <input readonly type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.city"/>\n                                                        </div>\n                                                        <!-- END CITY -->\n                                                     <!-- START COUNTRY -->\n                                                        <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                                                                  <input readonly type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.country"/>\n                                                       </div>\n                                                        <!-- END COUNTRY -->\n                                                  </form>\n                                       </div>\n                                        <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.shipmentAddress" novalidate>\n                                                        <!-- START STREET -->\n                                                         <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                                                           <input readonly type="text" name="sStreet" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.sStreet"/>\n                                                        </div>\n                                                        <!-- END STREET -->\n\n                                                         <!-- START POSTALCODE -->\n                                                     <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                                                               <input readonly type="text" name="sPostalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.sPostalCode"/>\n                                                    </div>\n                                                        <!-- END POSTALCODE -->\n\n                                                     <!-- START CITY -->\n                                                   <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                                                             <input readonly type="text" name="sCity" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.sCity"/>\n                                                      </div>\n                                                        <!-- END CITY -->\n                                                     <!-- START COUNTRY -->\n                                                        <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                                                                  <input readonly type="text" name="sCountry" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.sCountry"/>\n                                                     </div>\n                                                        <!-- END COUNTRY -->\n                                                  </form>\n                                       </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\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/main/customDateFilter.modal.html",'<div class="modal-body">\n  <uib-datepicker ng-model="dateTime.filterDate"\n      class="well well-sm">\n  </uib-datepicker>\n  <uib-timepicker data-ng-if="hasTime" ng-model="dateTime.time" show-meridian="false"></uib-timepicker>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="setFilterDate(dateTime.filterDate)">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancelDateFilter()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/customDateFilterHeader.html",'<input class="ui-grid-filter-input date-time-filter-buttons pointer-cursor" style="width:90%;padding:inherit;" data-ng-click="openDatePicker(colFilter)" placeholder="{{ colFilter.name }}" readonly value="{{colFilter.term | date:\'dd-MM-yyyy\'}}">\n<span role="button" class="ui-grid-filter-button-select cancel-custom-date-range-filter-button ng-scope" data-ng-click="removeFilter(colFilter, $index)" data-ng-if="!colFilter.disableCancelFilterButton" data-ng-disabled="colFilter.term === undefined || colFilter.term === null || colFilter.term === \'\'" data-ng-show="colFilter.term !== undefined && colFilter.term != null" tabindex="0" aria-hidden="false" aria-disabled="false" style="right:22px;">\n  <i class="ui-grid-icon-cancel cancel-custom-date-range-filter" ui-grid-one-bind-aria-label="aria.removeFilter" aria-label="Remove Filter">&nbsp;</i>\n</span>\n'),a.put("app/main/customTagsFilter.modal.html",'<div class="modal-body" data-ng-init="initModal()">\n  <!-- START TAGS -->\n<div class="form-group">\n  <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n  <ui-select multiple=\'true\' data-ng-model="item.myTags" 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</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="setFilterTags()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancelTagsFilter()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/customTagsFilterHeader.html",'<input class="ui-grid-filter-input pointer-cursor" style="width:90%;padding:inherit;" data-ng-click="openTags(colFilter)" placeholder="{{ colFilter.name }}" readonly value="{{colFilter.term}}">\n<span role="button" class="ui-grid-filter-button-select cancel-custom-date-range-filter-button ng-scope" data-ng-click="removeFilter(colFilter, $index)" data-ng-if="!colFilter.disableCancelFilterButton" data-ng-disabled="colFilter.term === undefined || colFilter.term === null || colFilter.term === \'\'" data-ng-show="colFilter.term !== undefined && colFilter.term != null" tabindex="0" aria-hidden="false" aria-disabled="false" style="right:5px;">\n  <i class="ui-grid-icon-cancel cancel-custom-date-range-filter" ui-grid-one-bind-aria-label="aria.removeFilter" aria-label="Remove Filter">&nbsp;</i>\n</span>\n'),a.put("app/main/main.html",'<!-- BEGIN HEADER -->\n<div data-ng-include="\'components/header/header.html\'" data-ng-controller="HeaderController" class="page-header navbar navbar-fixed-top">\n</div>\n<!-- END HEADER -->\n\n<div class="clearfix">\n</div>\n<!-- BEGIN CONTAINER -->\n<div class="page-container">\n\n  <!-- BEGIN SIDEBAR -->\n  <div data-ng-include="\'components/sidebar/sidebar.html\'" data-ng-controller="SidebarController" class="page-sidebar-wrapper">\n  </div>\n  <!-- END SIDEBAR -->\n\n  <!-- BEGIN CONTENT -->\n  <div class="page-content-wrapper">\n    <div class="page-content" data-ng-class="{\'demo\': !license.expiration}">\n\n      <!-- BEGIN PAGE CONTENT -->\n      <uib-tabset>\n        <uib-tab select="addWorkspace()" active="mainTab.active">\n          <uib-tab-heading>\n            Motion <i class="icon-rocket"></i>\n          </uib-tab-heading>\n          <div class="hide" data-ng-if="!Auth.isAgent() && activeTour.main" ng-joy-ride="activeTour.main" config="tourConfig.main" on-finish="onTourFinish()" on-skip="onTourSkip()"></div>\n          <div ui-view class=""></div>\n        </uib-tab>\n        <uib-tab class="motion-{{workspace.type}}-uib-tab" data-ng-repeat="workspace in workspaces" active="workspace.active" data-ng-switch="workspace.type" select="select(workspace)" deselect="deselect(workspace)">\n          <uib-tab-heading data-ng-mouseup="$event.which === 2 && closeTab($index)">\n            <i data-ng-if="workspace.class" class="prova" data-ng-class="workspace.class"></i> {{workspace.name | truncate: 25: \'...\': true}} <span class="badge badge-danger" data-ng-if="workspace.unread">{{workspace.unread}}</span> <i class="icon-close pointer-cursor" data-ng-click="closeTab($index)"></i>\n          </uib-tab-heading>\n          <div class="" data-ng-switch="workspace.type">\n            <new-contact data-ng-switch-when="newContact" workspace="workspace" index="$index" on-submit="createContact(index,item)"></new-contact>\n            <contact data-ng-switch-when="contact" workspace="workspace" index="$index" on-submit="updateContact(index,item)"></contact>\n            <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeJscriptyTab(index)"></jscripty>\n            <!-- <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeTab(index,item)"></jscripty> -->\n            <chat-room data-ng-switch-when="chatRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></chat-room>\n            <fax-room data-ng-switch-when="faxRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></fax-room>\n            <mail-room data-ng-switch-when="mailRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></mail-room>\n            <sms-room data-ng-switch-when="smsRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></sms-room>\n            <openchannel-room data-ng-switch-when="openchannelRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></openchannel-room>\n            <tiger-dial-disposal data-ng-switch-when="tdDisposal" workspace="workspace" index="$index"></tiger-dial-disposal>\n          </div>\n        </uib-tab>\n      </uib-tabset>\n      <!-- END PAGE CONTENT  -->\n\n    </div>\n  </div>\n  <!-- END CONTENT -->\n\n</div>\n<!-- END CONTAINER -->\n\n<!-- BEGIN FOOTER -->\n<div data-ng-include="\'components/footer/footer.html\'" data-ng-controller="FooterController" class="page-footer">\n</div>\n<!-- END FOOTER -->\n\n<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->\n<!-- BEGIN CORE PLUGINS -->\n<!--[if lt IE 9]>\n<script src="../../assets/global/plugins/respond.min.js"></script>\n<script src="../../assets/global/plugins/excanvas.min.js"></script>\n<![endif]-->\n\n<!-- END JAVASCRIPTS -->\n'),
+a.put("app/jscripty/project/report/report.sessions.html",'\n   <div class="row" >\n            <div class="col-md-12">\n                       <div class="portlet light bordered" data-ng-init="getProjectSessions()">\n                                                              <div class="portlet-title">\n                                                                   <div class="caption font-green-sharp">\n                                                                                <i class="icon-settings font-green-sharp"></i>\n                                                                                <span class="caption-subject">{{ \'APPLICATION_SESSIONS\' | translate }}</a> </span>\n                                                                  </div>\n                                                                        <div class="actions">\n                                                                         <div class="btn-group">\n                                                                                       <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();initView()">\n                                                                                         <i class="icon-reload"></i>\n                                                                                   </a>\n                                                                          </div>\n                                                                        </div>\n                                                                </div>\n                                                                <div class="portlet-body" >\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                                                        </div>\n                                </div>\n                        </div>\n        </div>\n'),a.put("app/jscripty/project/report/report.summary.html",'<div class="row">\n <div class="col-md-12">\n               <div class="portlet light bordered" data-ng-init="getQuestionSummary()">\n                                                      <div class="portlet-title">\n                                                           <div class="caption font-green-sharp">\n                                                                        <i class="fa fa-bar-chart font-green-sharp"></i>\n                                                                      <span class="caption-subject">{{ \'APPLICATION_QUESTIONS\' | translate }}</a> </span>\n                                                         </div>\n                                                                <div class="actions">\n                                                                 <div class="btn-group">\n                                                                               <!-- <a class="btn btn-default" href="#" data-ng-click="gridOptions.getPage();initView()">\n                                                                                    <i class="icon-reload"></i>\n                                                                           </a> -->\n                                                                      </div>\n                                                                </div>\n                                                        </div>\n                                                        <div class="portlet-body" >\n                                                                           <div ui-grid="gridOptions" 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                                                        </div>\n                                </div>\n        </div>\n</div>\n'),a.put("app/jscripty/project/view/view.html",'<div class="row" data-ng-init="getProject()">\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-edit"></i>\n                                            <a href="/jscripty/projects/list">{{ \'APPLICATION_JSCRIPTY\' | translate }}</a>\n                                              <i class="fa fa-angle-right"></i>\n                                     </li>\n                                 <li>\n                                          <i class="fa fa-slack"></i>\n                                           <a href="/jscripty/projects/list">{{ \'APPLICATION_PROJECTS\' | translate }}</a>\n            <i class="fa fa-angle-right"></i>\n                                       </li>\n          <li>\n                                         <a ng-href="/jscripty/projects/view/{{jscriptyProject.id}}">{{jscriptyProject.name}}</a>\n          </li>\n                             </ul>\n                 </div>\n                </div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row">\n  <div class="col-md-12">\n              <div id="geEditor" class="geEditor"></div>\n  </div>\n</div>\n<!-- END PAGE CONTENT-->\n<script>\n\n\n</script>\n'),a.put("app/landing/landing.html",'<!-- BEGIN LOGO -->\n<div class="logo">\n  <a href="index.html">\n    <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big.png" alt="logo" />\n    <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big\'}}" alt="logo" class="custom-login-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big.png\';"/>\n  </a>\n</div>\n<!-- END LOGO -->\n\n<!-- BEGIN LANDING -->\n<div data-ng-init="initLanding()">\n  <div data-ng-show="message" class="col-md-12 page-500" style="padding-bottom: 50px;">\n    <div class="number">\n      Oops!\n    </div>\n    <div class=" details" style="color: white;">\n      <h3>{{message | translate}}.</h3>\n      <p>\n        Please contact your administrator.<br><br>\n      </p>\n    </div>\n  </div>\n</div>\n<!-- END LANDING -->\n\n<div class="copyright">\n  xCALLY Motion v. {{info.version}} | 2016 - {{year + 1}} &copy; Powered by Xenialab <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="\'| \'+settings.footerWhiteLabel"></ng-bind-html>\n</div>\n'),a.put("app/login/login.html",'<!-- BEGIN LOGO -->\n<div class="logo" data-ng-init="getInfo()">\n       <a>\n           <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big.png" alt="logo" />\n              <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big.png\'}}" alt="logo" class="custom-login-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big.png\';"/>\n    </a>\n</div>\n<!-- END LOGO -->\n<!-- BEGIN LOGIN -->\n<div class="content">\n  <!-- BEGIN LOGIN FORM -->\n     <form class="login-form" name="loginForm" data-ng-if="!forgotPassword" data-ng-submit="login(loginForm)" novalidate>\n          <h3 class="form-title">Sign In</h3>\n           <div class="alert alert-success" data-ng-show="recovered">\n                    <button class="close" data-close="alert"></button>\n                    <span>{{\'MESSAGE_ACCOUNT_RECOVERED\' | translate}}</span>\n            </div>\n                <div class="alert alert-danger" data-ng-class="{\'display-hide\': !loginForm.$submitted || !errorLogin}">\n                     <button class="close" data-close="alert"></button>\n                    <span>{{ errorLog ? errorLog : (\'MESSAGE_INSERT_USER_OR_PASS\' | translate)}}</span>\n         </div>\n                <div class="form-group" data-ng-class="{\'has-error\': loginForm.$submitted && loginForm.name.$invalid}">\n                     <label class="control-label">{{\'APPLICATION_USERNAME\' | translate}}</label>\n                 <div class="input-icon">\n                              <i class="fa fa-user"></i>\n                            <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="{{\'APPLICATION_USERNAME\' | translate}}" name="name" ng-model="userLogin.name" required/>\n                  </div>\n                        <span data-ng-show="loginForm.$submitted && loginForm.name.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n             </div>\n                <div class="form-group" data-ng-class="{\'has-error\': loginForm.$submitted && loginForm.password.$invalid}">\n                 <label class="control-label">{{\'APPLICATION_PASSWORD\' | translate}}</label>\n                 <div class="input-icon">\n                              <i class="fa fa-lock"></i>\n                            <input ng-enter="login(loginForm)" class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="{{\'APPLICATION_PASSWORD\' | translate}}" name="password" ng-model="userLogin.password" required/>\n                      </div>\n                        <span data-ng-show="loginForm.$submitted && loginForm.password.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n                 <span class="help-block"><a href="#" data-ng-click="toggleForgotPassword(true)" class="forget-password">{{\'APPLICATION_FORGOT_PASSWORD\' | translate}}?</a></span>\n           </div>\n                <div class="form-actions">\n                    <button type="submit" class="btn btn-success uppercase">{{\'APPLICATION_LOGIN\' | translate}}</button>\n                        <label class="rememberme check">\n                              <input type="checkbox" data-ng-model="userLogin.remember"> {{\'APPLICATION_REMEMBER_ME\' | translate}}\n                        </label>\n                      <!-- <label class="rememberme check">\n                 <input type="checkbox" name="remember" value="1"/>Remember </label> -->\n                       <!-- <a href="javascript:;" id="forget-password" class="forget-password">Forgot Password?</a> -->\n             </div>\n        </form>\n       <form name="forgetForm" data-ng-if="forgotPassword" data-ng-submit="forgetForm.$valid && recover()" novalidate>\n               <h3>{{\'APPLICATION_FORGOT_PASSWORD\' | translate}}?</h3>\n             <p>\n                   {{\'APPLICATION_INSERT_EMAIL_TO_RESET\' | translate}}\n         </p>\n          <div class="alert alert-success" data-ng-show="showRecoverMessage">\n                   <button class="close" data-close="alert"></button>\n                    <span>{{\'MESSAGE_CHECK_YOUR_EMAIL_RECOVER\' | translate}}</span>\n             </div>\n                <div class="form-group" data-ng-class="{\'has-error\': forgetForm.$submitted && forgetForm.email.$invalid}">\n                  <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                    <div class="input-icon">\n                              <i class="fa fa-envelope"></i>\n                                <input class="form-control form-control-solid placeholder-no-fix" type="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" name="email" ng-model="userLogin.email" required/>\n                 </div>\n                        <span data-ng-show="forgetForm.$submitted && forgetForm.email.$invalid" class="help-block">{{\'MESSAGE_REQUIRED_FIELD\' | translate}}</span>\n          </div>\n                <div class="form-actions">\n                    <button type="button" id="back-btn" data-ng-click="toggleForgotPassword(false)" class="btn btn-default">{{\'APPLICATION_BACK\' | translate}}</button>\n                 <button type="submit" class="btn btn-success uppercase pull-right">{{\'APPLICATION_SUBMIT\' | translate}}</button>\n            </div>\n        </form>\n               <div class="login-options">\n                   <h4>{{\'APPLICATION_FOLLOW_US\' | translate}}</h4>\n                    <ul class="social-icons">\n                             <li>\n                <a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xcallymotion" target="_blank"></a>\n              </li>\n                 <li>\n                    <a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xcallymotion" target="_blank"></a>\n             </li>\n                 <li>\n                    <a class="social-icon-color googleplus" data-original-title="Google Plus" href="https://plus.google.com/+Xcally" target="_blank"></a>\n               </li>\n                 <li>\n                    <a class="social-icon-color linkedin" data-original-title="Linkedin" href="https://www.linkedin.com/company/xcally" target="_blank"></a>\n                    </li>\n                     </ul>\n         </div>\n</div>\n<div class="copyright">\n       xCALLY Motion v. {{info.version}} | 2016 - {{year + 1}} &copy; Powered by Xenialab <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="\'| \'+settings.footerWhiteLabel"></ng-bind-html>\n</div>\n<!-- END LOGIN -->\n'),a.put("app/main/about.modal.html",'<div class="center-text">\n<div class="modal-header no-border">\n<button type="button" ng-click="$dismiss()" class="close">&times;</button>\n  <!-- <h3 class="modal-title center-text">{{ \'APPLICATION_ABOUT\' | translate }}</h3> -->\n</div>\n<div class="modal-body" style="padding-top:0px;">\n  <div  class="mbottom20" data-ng-init="getInfo()">\n    <a>\n           <img data-ng-if="settings.defaultLoginLogo || !license.custom" ng-src="assets/images/logo-big-pdf.png" alt="logo" class="about-logo" />\n               <img data-ng-if="license.custom && !settings.defaultLoginLogo" ng-src="api/settings/logo/login/{{settings.loginLogo ? settings.loginLogo : \'logo-big-pdf.png\'}}" alt="logo" class="custom-login-logo about-logo" onError="this.onerror=null;this.src=\'assets/images/logo-big-pdf.png\';"/>\n </a>\n</div>\n<div class="mbottom20">\n  <b class="sounds-title-icon">xCALLY Motion</b><br>\n  <small>v. {{info.version}}</small><br><br>\n  <small>2016 - {{year + 1}} &copy; Powered by Xenialab</small><br>\n  <small><a href="https://www.xcallymotion.com">www.xcallymotion.com</a></small><br>\n  <ng-bind-html data-ng-if="license.custom && !settings.defaultFooterWhiteLabel && settings.footerWhiteLabel" ng-bind-html="settings.footerWhiteLabel"></ng-bind-html>\n</div>\n<div class="mbottom20">\n  <span><b>{{\'APPLICATION_USEFUL_LINKS\' | translate}}</b></span><br>\n  <small><a href="https://wiki.xcallymotion.com/" target="_blank">Wiki</a></small><br>\n  <small><a href="http://www.xcally.com/bar/multichannel/Setup.msi" target="_blank">Phonebar Download</a></small><br>\n  <small><a href="http://www.xcally.com/support/eula-xcally-license-en.pdf" target="_blank">EULA</a></small><br>\n</div>\n  <div class="login-options" style=\'margin-bottom:0px;\'>\n  <h4>{{\'APPLICATION_FOLLOW_US\' | translate}}</h4>\n  <ul class="social-icons">\n    <li>\n      <a class="social-icon-color facebook" data-original-title="facebook" href="https://www.facebook.com/xcallymotion" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color twitter" data-original-title="Twitter" href="https://twitter.com/xcallymotion" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color googleplus" data-original-title="Google Plus" href="https://plus.google.com/+Xcally" target="_blank"></a>\n    </li>\n    <li>\n      <a class="social-icon-color linkedin" data-original-title="Linkedin" href="https://www.linkedin.com/company/xcally" target="_blank"></a>\n    </li>\n  </ul>\n</div>\n<div class="login-options" style=\'margin-bottom:0px;\'>\n<h4>{{\'APPLICATION_CONTACT_US\' | translate}}:</h4>\n<div class="float-right" style="margin-top:10px;margin-bottom:10px;">\n  <a href="mailto:support@xcally.com">support@xcally.com</a></small>\n</div>\n</div>\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/main/audioFileDownload.play.modal.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" style="text-align:center;">\n  <audio controls autoplay ng-src="{{audio}}" preload="none">\n    Your browser does not support the audio tag.</audio>\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/main/chooseContact.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_CHOOSE_CONTACT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <table st-table="rowCollection" class="table table-striped">\n      <tbody>\n       <tr ng-repeat="contact in contacts">\n                  <td>{{contact.firstName}} {{contact.lastName || \'\'}}</td>\n           <td>{{contact.List.name}}</td>\n                <td>\n        <button class="btn default btn-xs green-stripe" data-ng-click="open(contact)">\n          {{ \'APPLICATION_OPEN\' | translate}}\n        </button>\n      </td>\n         </tr>\n    <tr data-ng-hide="contacts.length">\n      <td colspan="3" style="text-align:center;">\n        <i>{{ \'MESSAGE_NO_CONTACTS_AVAILABLE\' | translate }}</i>\n      </td>\n    </tr>\n         </tbody>\n  </table>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="open()"><i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.html",'<div class="modal-header" data-ng-init="getContacts()">\n  <h3 class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <p>{{\'MESSAGE_CLOSE_EDITED_TAB\' | translate}}</p>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/closeEditedTab.modal.jscripty.html",' <div class="modal-header" data-ng-init="init()">\n  <h3  class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3>\n  <!-- <h3   ng-if="projectStatus == \'incomplete\'" class="modal-title">{{ \'APPLICATION_WARNING\' | translate }}</h3> -->\n\n</div>\n<div   class="modal-body">\n<!-- <div  ng-if="projectStatus == \'incomplete\'" class="modal-body"> -->\n  <p>{{\'MESSAGE_CLOSE_INCOMPLETE\' | translate}}</p>\n</div>\n\n\n<div class="modal-footer">\n  <button class="btn btn-danger" type="button" ng-click="close()">{{ \'APPLICATION_CLOSE\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/cm.disposition.modal.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  <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()"  data-ng-disabled="!item.disposition">{{ \'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/main/company.info.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_COMPANY_INFO\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <div class="row">\n     <div class="col-md-12">\n               <div class="portlet light">\n                   <div class="portlet-title tabbable-line">\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                                         <li>\n                                                  <a href="#" data-target="#tab_1_2" data-toggle="tab">{{ \'APPLICATION_ADDRESS\' | translate}}</a>\n                                     </li>\n                                         <li>\n                                                  <a href="#" data-target="#tab_1_3" data-toggle="tab">{{ \'APPLICATION_SHIPMENT_ADDRESS\' | 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 && updateCompany()" novalidate>\n                                                       <div class="row">\n                                                             <div class="col-md-6">\n                                                                        <!-- START NAME -->\n                                                                   <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_NAME\' | translate}}</label>\n                                                                             <input readonly type="text" name="name" placeholder="{{\'APPLICATION_NAME\' | translate}}" class="form-control" data-ng-model="company.name" required/>\n                                                                       </div>\n                                                                        <!-- END NAME -->\n\n                                                                   <!-- START VAT -->\n                                                                    <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_VAT\' | translate}}</label>\n                                                                              <input readonly type="text" name="vat" placeholder="{{\'APPLICATION_VAT\' | translate}}" class="form-control" data-ng-model="company.vat"/>\n                                                                   </div>\n                                                                        <!-- END VAT -->\n\n                                                                    <!-- START COMPANYID -->\n                                                                      <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_COMPANY_ID\' | translate}}</label>\n                                                                               <input readonly type="text" name="companyId" placeholder="{{\'APPLICATION_COMPANY_ID\' | translate}}" class="form-control" data-ng-model="company.companyId"/>\n                                                                        </div>\n                                                                        <!-- END COMPANYID -->\n\n                                                                      <!-- START WEBSITE -->\n                                                                        <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_WEBSITE\' | translate}}</label>\n                                                                                  <input readonly type="text" name="website" placeholder="{{\'APPLICATION_WEBSITE\' | translate}}" class="form-control" data-ng-model="company.website"/>\n                                                                       </div>\n                                                                        <!-- END WEBSITE -->\n\n                                                                        <!-- START EMAIL -->\n                                                                          <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                                                                            <input readonly type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="company.email"/>\n                                                                    </div>\n                                                                        <!-- END EMAIL -->\n                                                            </div>\n                                                                <div class="col-md-6">\n                                                                        <!-- START PHONE -->\n                                                                          <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                                                                            <input readonly type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="company.phone"/>\n                                                                     </div>\n                                                                        <!-- END PHONE -->\n\n                                                                          <!-- START FAX -->\n                                                                    <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                                                                              <input readonly type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="company.fax"/>\n                                                                   </div>\n                                                                        <!-- END FAX -->\n\n                                                                    <!-- START TYPE -->\n                                                                   <div class="form-group" >\n                                                                             <label class="control-label">{{\'APPLICATION_TYPE\' | translate}}</label>\n                                                                             <input readonly type="text" name="type" placeholder="{{\'APPLICATION_TYPE\' | translate}}" class="form-control" data-ng-model="company.type"/>\n                                                                        </div>\n                                                                        <!-- END TYPE -->\n\n                                                                   <!-- START DESCRIPTION -->\n                                                                    <div class="form-group">\n                                                                              <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                                                                              <textarea readonly type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="company.description"></textarea>\n                                                                      </div>\n                                                                        <!-- END DESCRIPTION -->\n                                                              </div>\n                                                        </div>\n                                                </form>\n                                       </div>\n                                        <!-- END ADVANCED TAB -->\n                                     <div class="tab-pane" id="tab_1_2">\n                                           <form name="forms.address" novalidate>\n                                                        <!-- START STREET -->\n                                                         <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                                                           <input readonly type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.street"/>\n                                                          </div>\n                                                        <!-- END STREET -->\n\n                                                         <!-- START POSTALCODE -->\n                                                     <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                                                               <input readonly type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.postalCode"/>\n                                                      </div>\n                                                        <!-- END POSTALCODE -->\n\n                                                     <!-- START CITY -->\n                                                   <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                                                             <input readonly type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.city"/>\n                                                        </div>\n                                                        <!-- END CITY -->\n                                                     <!-- START COUNTRY -->\n                                                        <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                                                                  <input readonly type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.country"/>\n                                                       </div>\n                                                        <!-- END COUNTRY -->\n                                                  </form>\n                                       </div>\n                                        <div class="tab-pane" id="tab_1_3">\n                                           <form name="forms.shipmentAddress" novalidate>\n                                                        <!-- START STREET -->\n                                                         <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                                                           <input readonly type="text" name="sStreet" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="company.sStreet"/>\n                                                        </div>\n                                                        <!-- END STREET -->\n\n                                                         <!-- START POSTALCODE -->\n                                                     <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                                                               <input readonly type="text" name="sPostalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="company.sPostalCode"/>\n                                                    </div>\n                                                        <!-- END POSTALCODE -->\n\n                                                     <!-- START CITY -->\n                                                   <div class="form-group" >\n                                                             <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                                                             <input readonly type="text" name="sCity" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="company.sCity"/>\n                                                      </div>\n                                                        <!-- END CITY -->\n                                                     <!-- START COUNTRY -->\n                                                        <div class="form-group">\n                                                              <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                                                                  <input readonly type="text" name="sCountry" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="company.sCountry"/>\n                                                     </div>\n                                                        <!-- END COUNTRY -->\n                                                  </form>\n                                       </div>\n                                </div>\n                        </div>\n                </div>\n        </div>\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/main/customDateFilter.modal.html",'<div class="modal-body">\n  <uib-datepicker ng-model="dateTime.filterDate"\n      class="well well-sm">\n  </uib-datepicker>\n  <uib-timepicker data-ng-if="hasTime" ng-model="dateTime.time" show-meridian="false"></uib-timepicker>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="setFilterDate(dateTime.filterDate)">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancelDateFilter()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/customDateFilterHeader.html",'<input class="ui-grid-filter-input date-time-filter-buttons pointer-cursor" style="width:90%;padding:inherit;" data-ng-click="openDatePicker(colFilter)" placeholder="{{ colFilter.name }}" readonly value="{{colFilter.term | date:\'dd-MM-yyyy\'}}">\n<span role="button" class="ui-grid-filter-button-select cancel-custom-date-range-filter-button ng-scope" data-ng-click="removeFilter(colFilter, $index)" data-ng-if="!colFilter.disableCancelFilterButton" data-ng-disabled="colFilter.term === undefined || colFilter.term === null || colFilter.term === \'\'" data-ng-show="colFilter.term !== undefined && colFilter.term != null" tabindex="0" aria-hidden="false" aria-disabled="false" style="right:22px;">\n  <i class="ui-grid-icon-cancel cancel-custom-date-range-filter" ui-grid-one-bind-aria-label="aria.removeFilter" aria-label="Remove Filter">&nbsp;</i>\n</span>\n'),a.put("app/main/customTagsFilter.modal.html",'<div class="modal-body" data-ng-init="initModal()">\n  <!-- START TAGS -->\n<div class="form-group">\n  <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n  <ui-select multiple=\'true\' data-ng-model="item.myTags" 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</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="setFilterTags()">{{ \'APPLICATION_CONFIRM\' | translate }}</button>\n  <button class="btn default" type="button" ng-click="cancelTagsFilter()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/customTagsFilterHeader.html",'<input class="ui-grid-filter-input pointer-cursor" style="width:90%;padding:inherit;" data-ng-click="openTags(colFilter)" placeholder="{{ colFilter.name }}" readonly value="{{colFilter.term}}">\n<span role="button" class="ui-grid-filter-button-select cancel-custom-date-range-filter-button ng-scope" data-ng-click="removeFilter(colFilter, $index)" data-ng-if="!colFilter.disableCancelFilterButton" data-ng-disabled="colFilter.term === undefined || colFilter.term === null || colFilter.term === \'\'" data-ng-show="colFilter.term !== undefined && colFilter.term != null" tabindex="0" aria-hidden="false" aria-disabled="false" style="right:5px;">\n  <i class="ui-grid-icon-cancel cancel-custom-date-range-filter" ui-grid-one-bind-aria-label="aria.removeFilter" aria-label="Remove Filter">&nbsp;</i>\n</span>\n'),a.put("app/main/main.html",'<!-- BEGIN HEADER -->\n<div data-ng-include="\'components/header/header.html\'" data-ng-controller="HeaderController" class="page-header navbar navbar-fixed-top">\n</div>\n<!-- END HEADER -->\n\n<div class="clearfix">\n</div>\n<!-- BEGIN CONTAINER -->\n<div class="page-container" data-ng-init="initMain();initTours();">\n\n  <!-- BEGIN SIDEBAR -->\n  <div data-ng-include="\'components/sidebar/sidebar.html\'" data-ng-controller="SidebarController" class="page-sidebar-wrapper">\n  </div>\n  <!-- END SIDEBAR -->\n\n  <!-- BEGIN CONTENT -->\n  <div class="page-content-wrapper">\n    <div class="page-content" data-ng-class="{\'demo\': !license.expiration}">\n\n      <!-- BEGIN PAGE CONTENT -->\n      <uib-tabset>\n        <uib-tab select="addWorkspace()" active="mainTab.active">\n          <uib-tab-heading>\n            Motion <i class="icon-rocket"></i>\n          </uib-tab-heading>\n          <div class="hide" data-ng-if="!Auth.isAgent() && activeTour.main" ng-joy-ride="activeTour.main" config="tourConfig.main" on-finish="onTourFinish()" on-skip="onTourSkip()"></div>\n          <div ui-view class=""></div>\n        </uib-tab>\n        <uib-tab class="motion-{{workspace.type}}-uib-tab" data-ng-repeat="workspace in workspaces" active="workspace.active" data-ng-switch="workspace.type" select="select(workspace)" deselect="deselect(workspace)">\n          <uib-tab-heading data-ng-mouseup="$event.which === 2 && closeTab($index)">\n            <i data-ng-if="workspace.class" class="prova" data-ng-class="workspace.class"></i> {{workspace.name | truncate: 25: \'...\': true}} <span class="badge badge-danger" data-ng-if="workspace.unread">{{workspace.unread}}</span> <i class="icon-close pointer-cursor" data-ng-click="closeTab($index)"></i>\n          </uib-tab-heading>\n          <div class="" data-ng-switch="workspace.type">\n            <new-contact data-ng-switch-when="newContact" workspace="workspace" index="$index" on-submit="createContact(index,item)"></new-contact>\n            <contact data-ng-switch-when="contact" workspace="workspace" index="$index" on-submit="updateContact(index,item)"></contact>\n            <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeJscriptyTab(index)"></jscripty>\n            <!-- <jscripty data-ng-switch-when="jscripty" workspace="workspace" index="$index" on-submit="closeTab(index,item)"></jscripty> -->\n            <chat-room data-ng-switch-when="chatRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></chat-room>\n            <fax-room data-ng-switch-when="faxRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></fax-room>\n            <mail-room data-ng-switch-when="mailRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></mail-room>\n            <sms-room data-ng-switch-when="smsRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></sms-room>\n            <openchannel-room data-ng-switch-when="openchannelRoom" workspace="workspace" index="$index" on-submit="closeTab(index)"></openchannel-room>\n            <tiger-dial-disposal data-ng-switch-when="tdDisposal" workspace="workspace" index="$index"></tiger-dial-disposal>\n          </div>\n        </uib-tab>\n      </uib-tabset>\n      <!-- END PAGE CONTENT  -->\n\n    </div>\n  </div>\n  <!-- END CONTENT -->\n\n</div>\n<!-- END CONTAINER -->\n\n<!-- BEGIN FOOTER -->\n<div data-ng-include="\'components/footer/footer.html\'" data-ng-controller="FooterController" class="page-footer">\n</div>\n<!-- END FOOTER -->\n\n<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->\n<!-- BEGIN CORE PLUGINS -->\n<!--[if lt IE 9]>\n<script src="../../assets/global/plugins/respond.min.js"></script>\n<script src="../../assets/global/plugins/excanvas.min.js"></script>\n<![endif]-->\n\n<!-- END JAVASCRIPTS -->\n'),
 a.put("app/main/mergeContact.choose.modal.html",'<div class="modal-header" data-ng-init="initView()">\n  <h3 class="modal-title">{{ \'APPLICATION_CHOOSE_CONTACT_TO_MERGE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <!-- START TABLE -->\n<div data-ng-if="gridOptions" ui-grid="gridOptions" ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination 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 class="modal-footer">\n  <button class="btn default" type="button" ng-click="cancel()">{{ \'APPLICATION_CANCEL\' | translate }}</button>\n</div>\n'),a.put("app/main/mergeContact.merge.modal.html",'<div class="modal-header" data-ng-init="initView()">\n  <h3 class="modal-title">{{ \'APPLICATION_MERGE\' | translate }}</h3>\n</div>\n<div class="modal-body">\n      <form name="forms.general" data-ng-submit="submit({index:index,item:contact})" novalidate>\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light ">\n                <div class="portlet-body row">\n                    <div class="col-md-4">\n                      <!-- START FIRSTNAME -->\n                      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$invalid}">\n                        <label class="control-label">{{\'APPLICATION_FIRSTNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                        <input data-ng-if="fields.firstName.length <= 1" type="text" name="firstName" placeholder="{{\'APPLICATION_FIRSTNAME\' | translate}}" class="form-control" data-ng-model="contact.firstName" required/>\n                        <ui-select data-ng-if="fields.firstName.length > 1" data-ng-model="contact.firstName" theme="bootstrap" name="firstName" required>\n                          <ui-select-match placeholder="{{ \'APPLICATION_FIRSTNAME\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.firstName | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                        <span data-ng-show="(forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$error.required" class="help-block help-block-error">\n                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                        </span>\n                      </div>\n                      <!-- END FIRSTNAME -->\n\n                      <!-- START LASTNAME -->\n                      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$invalid}">\n                        <label class="control-label">{{\'APPLICATION_LASTNAME\' | translate}}</label>\n                        <input data-ng-if="fields.lastName.length <= 1" type="text" name="lastName" placeholder="{{\'APPLICATION_LASTNAME\' | translate}}" class="form-control" data-ng-model="contact.lastName"/>\n                        <ui-select data-ng-if="fields.lastName.length > 1" data-ng-model="contact.lastName" theme="bootstrap" name="lastName">\n                          <ui-select-match placeholder="{{ \'APPLICATION_LASTNAME\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.lastName | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                        <span data-ng-show="(forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$error.required" class="help-block help-block-error">\n                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                        </span>\n                      </div>\n                      <!-- END LASTNAME -->\n\n                      <!-- START COMPANY -->\n                      <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n                        <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n                          <ui-select data-ng-model="contact.CompanyId" theme="bootstrap" name="CompanyId" ng-disabled="!companies.length" required>\n                            <ui-select-match placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                            <ui-select-choices repeat="company.id as company in companies | filter: $select.search" null-option="scope.noCompany">\n                              <div ng-bind-html="company.name | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                        <div class="note note-warning" data-ng-hide="companies.length">\n                          <h4 class="block">Warning!</h4>\n                          <p>\n                            {{ \'MESSAGE_NO_COMPANIES_AVAILABLE\' | translate }}\n                          </p>\n                          <p>\n                            {{\'APPLICATION_GO_TO\' | translate}} <a href="/contactmanager/companies/list">{{\'APPLICATION_COMPANIES\' | translate}}</a>\n                          </p>\n                        </div>\n                        <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                          <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                        </span>\n                      </div>\n                      <!-- END COMPANY -->\n                    </div>\n                    <div class="col-md-4">\n                      <!-- START PHONE -->\n                      <div class="form-group" data-ng-class="{\'has-error\': (forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$invalid}">\n                        <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                        <input data-ng-if="fields.phone.length <= 1" type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="contact.phone"/>\n                        <ui-select data-ng-if="fields.phone.length > 1" data-ng-model="contact.phone" theme="bootstrap" name="phone">\n                          <ui-select-match placeholder="{{ \'APPLICATION_PHONE\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.phone | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                      <span data-ng-show="(forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$error.required" class="help-block help-block-error">\n                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                      </span>\n                    </div>\n                    <!-- END PHONE -->\n                    <!-- START MOBILE -->\n                    <div class="form-group" data-ng-class="{\'has-error\': (forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$invalid}">\n                      <label class="control-label">{{\'APPLICATION_MOBILE\' | translate}}</label>\n                      <input data-ng-if="fields.mobile.length <= 1" type="text" name="mobile" placeholder="{{\'APPLICATION_MOBILE\' | translate}}" class="form-control" data-ng-model="contact.mobile"/>\n                      <ui-select data-ng-if="fields.mobile.length > 1" data-ng-model="contact.mobile" theme="bootstrap" name="mobile">\n                        <ui-select-match placeholder="{{ \'APPLICATION_MOBILE\' | translate }}">{{$select.selected}}</ui-select-match>\n                        <ui-select-choices repeat="field in fields.mobile | filter: $select.search track by $index">\n                          <div ng-bind-html="field | highlight: $select.search"></div>\n                        </ui-select-choices>\n                      </ui-select>\n                    <span data-ng-show="(forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END MOBILE -->\n                  <!-- START EMAIL -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                    <input data-ng-if="fields.email.length <= 1" type="email" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="contact.email"/>\n                      <ui-select data-ng-if="fields.email.length > 1" data-ng-model="contact.email" theme="bootstrap" name="email">\n                        <ui-select-match placeholder="{{ \'APPLICATION_EMAIL\' | translate }}">{{$select.selected}}</ui-select-match>\n                        <ui-select-choices repeat="field in fields.email | filter: $select.search track by $index">\n                          <div ng-bind-html="field | highlight: $select.search"></div>\n                        </ui-select-choices>\n                      </ui-select>\n                    <span data-ng-show="(forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END EMAIL -->\n                </div>\n                <div class="col-md-4">\n                  <!-- START FAX -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                    <input data-ng-if="fields.fax.length <= 1" type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="contact.fax"/>\n                      <ui-select data-ng-if="fields.fax.length > 1" data-ng-model="contact.fax" theme="bootstrap" name="fax">\n                        <ui-select-match placeholder="{{ \'APPLICATION_FAX\' | translate }}">{{$select.selected}}</ui-select-match>\n                        <ui-select-choices repeat="field in fields.fax | filter: $select.search track by $index">\n                          <div ng-bind-html="field | highlight: $select.search"></div>\n                        </ui-select-choices>\n                      </ui-select>\n                    <span data-ng-show="(forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END FAX -->\n                  <!-- START TAGS -->\n                  <div class="form-group" data-ng-class="{\'has-error\': forms.general.tags.$invalid && forms.general.$submitted}">\n                    <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n                    <ui-select multiple=\'true\' data-ng-model="contact.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\n                      <ui-select-match placeholder="{{ \'APPLICATION_TAGS\' | translate }}">{{$item}}</ui-select-match>\n                      <ui-select-choices repeat="tag in tags | filter: $select.search">\n                        <div ng-bind-html="tag | highlight: $select.search"></div>\n                      </ui-select-choices>\n                    </ui-select>\n                    <span data-ng-show="forms.general.tags.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END TAGS -->\n                  <!-- START LIST -->\n                  <div class="form-group" data-ng-if="contact.id">\n                    <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                    <input type="text" name="list" placeholder="{{\'APPLICATION_LIST\' | translate}}" class="form-control" data-ng data-ng-model="contact.List.name" disabled/>\n                  </div>\n                  <!-- END LIST -->\n                </div>\n              </div>\n            </div>\n            <div class="portlet light upborder">\n                <div class="portlet-body row">\n                <div class="col-md-4">\n                  <!-- START STREET -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                    <input data-ng-if="fields.street.length <= 1" type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="contact.street"/>\n                        <ui-select data-ng-if="fields.street.length > 1" data-ng-model="contact.street" theme="bootstrap" name="street">\n                          <ui-select-match placeholder="{{ \'APPLICATION_STREET\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.street | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                    <span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END STREET -->\n\n                  <!-- START POSTALCODE -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                    <input data-ng-if="fields.postalCode.length <= 1" type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="contact.postalCode"/>\n                        <ui-select data-ng-if="fields.postalCode.length > 1" data-ng-model="contact.postalCode" theme="bootstrap" name="postalCode">\n                          <ui-select-match placeholder="{{ \'APPLICATION_POSTALCODE\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.postalCode | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                    <span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END POSTALCODE -->\n\n                  <!-- START CITY -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                    <input data-ng-if="fields.city.length <= 1" type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="contact.city"/>\n                        <ui-select data-ng-if="fields.city.length > 1" data-ng-model="contact.city" theme="bootstrap" name="city">\n                          <ui-select-match placeholder="{{ \'APPLICATION_CITY\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.city | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                    <span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END CITY -->\n                </div>\n                <div class="col-md-4">\n                  <!-- START COUNTRY -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                    <input data-ng-if="fields.country.length <= 1" type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="contact.country"/>\n                        <ui-select data-ng-if="fields.country.length > 1" data-ng-model="contact.country" theme="bootstrap" name="country">\n                          <ui-select-match placeholder="{{ \'APPLICATION_COUNTRY\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.country | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                    <span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END COUNTRY -->\n\n                  <!-- START DATEOFBIRTH -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n                    <input data-ng-if="fields.dateOfBirth.length <= 1" type="date" name="dateOfBirth" placeholder="{{\'APPLICATION_DATEOFBIRTH\' | translate}}" class="form-control" data-ng-model="contact.dateOfBirth"/>\n                    <ui-select data-ng-if="fields.dateOfBirth.length > 1" data-ng-model="contact.dateOfBirth" theme="bootstrap" name="dateOfBirth">\n                      <ui-select-match placeholder="{{ \'APPLICATION_DATEOFBIRTH\' | translate }}">{{$select.selected}}</ui-select-match>\n                      <ui-select-choices repeat="field in fields.dateOfBirth | filter: $select.search track by $index">\n                        <div ng-bind-html="field | highlight: $select.search"></div>\n                      </ui-select-choices>\n                    </ui-select>\n                      <span data-ng-show="(forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END DATEOFBIRTH -->\n\n                  <!-- START DESCRIPTION -->\n                  <div class="form-group">\n                    <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                    <textarea  style="resize: vertical;" data-ng-if="fields.description.length <= 1" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="contact.description"/></textarea>\n                        <ui-select data-ng-if="fields.description.length > 1" data-ng-model="contact.description" theme="bootstrap" name="description">\n                          <ui-select-match placeholder="{{ \'APPLICATION_DESCRIPTION\' | translate }}">{{$select.selected}}</ui-select-match>\n                          <ui-select-choices repeat="field in fields.description | filter: $select.search track by $index">\n                            <div ng-bind-html="field | highlight: $select.search"></div>\n                          </ui-select-choices>\n                        </ui-select>\n                  </div>\n                  <!-- END DESCRIPTION -->\n                </div>\n                <div class="col-md-4">\n                  <!-- START URL -->\n                  <div class="form-group" data-ng-class="{\'has-error\': (forms.general.url.$touched || forms.general.$submitted) && forms.general.url.$invalid}">\n                    <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                    <input data-ng-if="fields.url.length <= 1" type="text" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="contact.url"/>\n                    <ui-select data-ng-if="fields.url.length > 1" data-ng-model="contact.url" theme="bootstrap" name="url">\n                      <ui-select-match placeholder="{{ \'APPLICATION_URL\' | translate }}">{{$select.selected}}</ui-select-match>\n                      <ui-select-choices repeat="field in fields.url | filter: $select.search track by $index">\n                        <div ng-bind-html="field | highlight: $select.search"></div>\n                      </ui-select-choices>\n                    </ui-select>\n                    <span data-ng-show="(forms.general.url.$touched || forms.general.$submitted) && forms.general.url.$error.required" class="help-block help-block-error">\n                      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                    </span>\n                  </div>\n                  <!-- END URL -->\n                </div>\n              </div>\n            </div>\n          <div class="portlet light upborder" data-ng-if="customFields.length">\n            <div class="portlet-body">\n              <div class="row">\n              <div class="col-md-4" data-ng-repeat="customField in customFields">\n                <div data-ng-if="customField.type==\'text\'" class="form-group" data-ng-class="{\'has-error\': (forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$invalid}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <input data-ng-if="fields[customField.name].length <= 1" type="text" name="{{customField.name}}" placeholder="{{customField.alias}}" class="form-control" data-ng-model="contact[customField.name]"/>\n                  <ui-select data-ng-if="fields[customField.name].length > 1" data-ng-model="contact[customField.name]" theme="bootstrap" name="{{customField.name}}">\n                    <ui-select-match placeholder="{{customField.name}}">{{$select.selected}}</ui-select-match>\n                    <ui-select-choices repeat="field in fields[customField.name] | filter: $select.search track by $index">\n                      <div ng-bind-html="field | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span data-ng-show="(forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$error.required" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <div data-ng-if="customField.type==\'select\'" class="form-group" data-ng-class="{\'has-error\': forms.general[customField.name].$invalid && forms.general.$submitted}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <ui-select data-ng-model="contact[customField.name]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n                    <ui-select-match allow-clear placeholder="{{customField.alias}}">{{$select.selected.value}}</ui-select-match>\n                    <ui-select-choices repeat="choice.value as choice in customField.values | filter: $select.search">\n                      <div ng-bind-html="choice.value | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span data-ng-show="forms.general[customField.name].$invalid && forms.general.$submitted" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n              </div>\n            </div>\n            </div>\n          </div>\n          <!-- END PORTLET -->\n        </form>\n</div>\n<div class="modal-footer">\n  <button class="btn btn-success" type="button" ng-click="merge()" ng-disabled="forms.general.$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/main/template/actionBuilder/template.actionBuilderIntegration.html",'<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" data-ng-change="changeIntegration()" required>\n    <ui-select-match placeholder="{{ \'APPLICATION_INTEGRATION\' | translate }}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="integration.state as integration in integrations | filter: $select.search">\n      <div ng-bind-html="integration.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{\'APPLICATION_INTEGRATION\' | translate}}\n  </span>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-6" data-ng-if="element.data1 && accounts && randomName" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data2" name="data2{{randomName}}" theme="bootstrap" data-ng-change="changeAccount();" required>\n    <ui-select-match placeholder="{{\'APPLICATION_ACCOUNT\' | translate}}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="account.id as account in accounts | filter: $select.search">\n      <div ng-bind-html="account.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{\'APPLICATION_ACCOUNT\' | translate}}\n  </span>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-6" data-ng-if="element.data2 && configurations && randomName" data-ng-class="{\'has-error\': (form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data3" name="data3{{randomName}}" theme="bootstrap" required>\n    <ui-select-match placeholder="{{\'APPLICATION_CONFIGURATION\' | translate}}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="config.id as config in configurations | filter: $select.search">\n      <div ng-bind-html="config.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{\'APPLICATION_CONFIGURATION\' | translate}}\n  </span>\n  <span data-ng-show="(form[\'data3\'+randomName].$touched || form.$submitted) && form[\'data3\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderJscripty.html",'<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="project.id as project in projects | filter: $select.search">\n      <div ng-bind-html="project.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderMotionBar.html",'<!-- data1: 0 POPUP, 1 URL, 2 WINAPP -->\n<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required data-ng-change="changeMode();">\n    <ui-select-match placeholder="{{ \'APPLICATION_TYPE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="motionAction.value as motionAction in motionActions | filter: $select.search">\n      <div ng-bind-html="motionAction.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{ \'APPLICATION_TYPE\' | translate }}\n  </span>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n\n<!-- data1:0 data2:Template -->\n<div data-ng-if="randomName && element.data1==0" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data2" name="data2{{randomName}}" theme="bootstrap" required>\n    <ui-select-match placeholder="{{ \'APPLICATION_TEMPLATE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n      <div ng-bind-html="template.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{ \'APPLICATION_TEMPLATE\' | translate }}\n  </span>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n\n<!-- data1:1 data2:URL -->\n<div data-ng-if="randomName && element.data1==1" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="text" ng-model="element.data2" name="data2{{randomName}}" class="form-control" required placeholder="{{ \'APPLICATION_URL\' | translate }}"/>\n  <span class="help-block">\n    {{ \'APPLICATION_URL\' | translate }}\n  </span>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n\n<!-- data1:2 data2:Application data3:Arguments -->\n<div data-ng-if="randomName && element.data1==2" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="text" ng-model="element.data2" name="data2{{randomName}}" class="form-control" required placeholder="{{ \'APPLICATION_APPLICATION\' | translate }}"/>\n  <span class="help-block">\n    {{ \'APPLICATION_APPLICATION\' | translate }}\n  </span>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName && element.data1==2" class="form-group col-md-6">\n  <input type="text" ng-model="element.data3" name="data3{{randomName}}" class="form-control" placeholder="{{ \'APPLICATION_ARGUMENTS\' | translate }}"/>\n  <span class="help-block">\n    {{ \'APPLICATION_ARGUMENTS\' | translate }}\n  </span>\n</div>\n'),
 a.put("app/main/template/actionBuilder/template.actionBuilderStatus.html",'<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="status.value as status in states | filter: $select.search">\n      <div ng-bind-html="status.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/actionBuilder/template.actionBuilderTemplate.html",'<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="template.id as template in templates | filter: $select.search">\n      <div ng-bind-html="template.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="text" ng-model="element.data2" name="data2{{randomName}}" class="form-control" required/>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-6">\n  <input type="text" ng-model="element.data3" class="form-control"/>\n</div>\n'),a.put("app/main/template/actionBuilder/template.actionBuilderUrlForward.html",'<div data-ng-if="randomName" class="form-group col-md-6" data-ng-class="{\'has-error\': (form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.data1" name="data1{{randomName}}" theme="bootstrap" required>\n    <ui-select-match placeholder="{{ \'APPLICATION_TYPE\' | translate }}">{{$select.selected.name}}</ui-select-match>\n    <ui-select-choices repeat="type.value as type in types | filter: $select.search">\n      <div ng-bind-html="type.name | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span class="help-block">\n    {{\'APPLICATION_TYPE\' | translate}}\n  </span>\n  <span data-ng-show="(form[\'data1\'+randomName].$touched || form.$submitted) && form[\'data1\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="form-group col-md-6" data-ng-if="element.data1 && randomName" data-ng-class="{\'has-error\': (form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$invalid}">\n  <input type="url" ng-model="element.data2" placeholder="{{ \'APPLICATION_URL\' | translate }}" name="data2{{randomName}}" class="form-control" required/>\n  <span class="help-block">\n    {{\'APPLICATION_URL\' | translate}}\n  </span>\n  <span data-ng-show="(form[\'data2\'+randomName].$touched || form.$submitted) && form[\'data2\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/template.conditionBuilder.html",'<div data-ng-if="randomName" class="form-group col-md-4" data-ng-class="{\'has-error\': (form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.field" name="field{{randomName}}" theme="bootstrap" data-ng-change="checkCondition(element.field)" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="condition.value as condition in service.services[serviceindex].conditions | filter: $select.search">\n      <div ng-bind-html="condition.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'field\'+randomName].$touched || form.$submitted) && form[\'field\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div data-ng-if="randomName && element.field" class="form-group col-md-4" data-ng-class="{\'has-error\': (form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.operator" name="operator{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="operator.value as operator in _.find(service.services[serviceindex].conditions,{value:element.field}).operators | filter: $select.search">\n      <div ng-bind-html="operator.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'operator\'+randomName].$touched || form.$submitted) && form[\'operator\'+randomName].$error.required" class="help-block help-block-error">\n    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n  </span>\n</div>\n<div class="col-md-4" data-ng-if="elementType === \'input\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <input type="text" ng-model="element.value" class="form-control" name="value{{randomName}}" required/>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n      <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n    </span>\n</div>\n<div class="form-group col-md-4" data-ng-if="elementType === \'select\' && randomName && element.field" data-ng-class="{\'has-error\': (form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$invalid}">\n  <ui-select data-ng-model="element.value" name="value{{randomName}}" theme="bootstrap" required>\n    <ui-select-match>{{$select.selected.name | translate}}</ui-select-match>\n    <ui-select-choices repeat="value.value as value in values| filter: $select.search">\n      <div ng-bind-html="value.name | translate | highlight: $select.search"></div>\n    </ui-select-choices>\n  </ui-select>\n  <span data-ng-show="(form[\'value\'+randomName].$touched || form.$submitted) && form[\'value\'+randomName].$error.required" class="help-block help-block-error">\n'+"    <strong>{{'APPLICATION_WARNING' | translate}}!</strong> {{'MESSAGE_REQUIRED_FIELD' | translate}}.\n  </span>\n</div>\n"),a.put("app/main/template/template.contactTab.html",'<div class="row margin-top-20 contact-tab-container">\n  <div class="col-md-12 contact-tab">\n    <form name="forms.general" data-ng-submit="submit({index:index,item:contact})" novalidate>\n    <!-- BEGIN PROFILE CONTENT -->\n    <div class="profile-content">\n      <ul class="nav nav-tabs">\n  <li class="active">\n    <a href="#tab_1_1{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_DETAIL\' | translate}}</a>\n  </li>\n  <li data-ng-if="contact.id">\n    <a href="#tab_1_2{{contact.id || \'\'}}" data-toggle="tab">{{\'APPLICATION_CUSTOMER_JOURNEY\' | translate}}</a>\n  </li>\n</ul>\n<div class="tab-content">\n  <div class="tab-pane fade active in" id="tab_1_1{{contact.id || \'\'}}">\n    <!--end add-portfolio-->\n    <div class="row portfolio-block" data-ng-if="workspace.data && workspace.data.uniqueid && workspace.data.agentcalledAt">\n      <div class="col-md-3">\n        <div class="portfolio-text">\n          <img src="assets/images/media/CmCall.png" alt=""/>\n          <div class="portfolio-text-info">\n            <h4>{{\'MESSAGE_INBOUND_CALL_FROM\' | translate}} - {{workspace.data.calleridnum}}</h4>\n            <p>\n              {{\'MESSAGE_CALL_UNIQUEID\' | translate}} : {{workspace.data.uniqueid}}\n            </p>\n          </div>\n        </div>\n      </div>\n      <div class="col-md-2 portfolio-stat">\n        <div>{{\'APPLICATION_QUEUE\' | translate}} </div>\n        <p>  {{workspace.data.queue}} </p>\n      </div>\n      <div class="col-md-3 portfolio-stat">\n        <div>{{\'APPLICATION_AGENT\' | translate}} </div>\n        <p>  {{workspace.data.membername}} </p>\n      </div>\n      <div class="col-md-2 portfolio-stat">\n        <div>{{\'APPLICATION_DATE\' | translate}} </div>\n        <p>  {{workspace.data.agentcalledAt | date:\'dd/MM/yyyy HH:mm:ss\'}} </p>\n      </div>\n      <div class="col-md-2 portfolio-stat">\n        <button class="btn grey-cascade" type="button" data-ng-click="dispose()" data-ng-disabled="contact.disposed">\n          <i class="icon-target"></i> {{\'APPLICATION_DISPOSITION\' | translate}}\n        </button>\n      </div>\n    </div>\n            <!--end row-->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light ">\n            <div class="portlet-title">\n              <div class="caption caption-md">\n                <i class="icon-bar-chart theme-font hide"></i>\n                <span class="caption-subject font-blue-madison bold uppercase">{{\'APPLICATION_DETAIL\' | translate}}</span>\n              </div>\n              <div class="actions">\n                <div class="btn-group btn-group-devided" data-toggle="buttons">\n                  <button type="submit" data-ng-if="contact.id" title="{{\'APPLICATION_COPY\' | translate}}" class="btn btn-circle green btn-sm" data-ng-click="copy(contact.id)"><i class="fa fa-files-o"></i></button>\n                  <button type="submit" data-ng-if="contact.ListId" class="btn btn-circle purple btn-sm" title="{{\'APPLICATION_MERGE\' | translate}}" data-ng-click="merge(contact)"><i class="icon-link"></i></button>\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm active" data-ng-click="detail.tab=\'main\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_MAIN\' | translate}}</label>\n                  <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-click="detail.tab=\'other\'">\n                  <input type="radio" class="toggle">{{\'APPLICATION_OTHER\' | translate}}</label>\n                </div>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div data-ng-class="{\'hidden\':detail.tab != \'main\'}" class="portlet-body contact-portlet row">\n                <div class="col-md-4">\n              <!-- START FIRSTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FIRSTNAME\' | translate}}<span class="required" aria-required="true">*</span></label>\n                <input type="text" name="firstName" placeholder="{{\'APPLICATION_FIRSTNAME\' | translate}}" class="form-control" data-ng-model="contact.firstName" required/>\n                <span data-ng-show="(forms.general.firstName.$touched || forms.general.$submitted) && forms.general.firstName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FIRSTNAME -->\n\n              <!-- START LASTNAME -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$invalid}">\n                <label class="control-label">{{\'APPLICATION_LASTNAME\' | translate}}</label>\n                <input type="text" name="lastName" placeholder="{{\'APPLICATION_LASTNAME\' | translate}}" class="form-control" data-ng-model="contact.lastName"/>\n                <span data-ng-show="(forms.general.lastName.$touched || forms.general.$submitted) && forms.general.lastName.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END LASTNAME -->\n\n              <!-- START COMPANY -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.CompanyId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_COMPANY\' | translate}}</label>\n                <div class="input-group">\n                  <ui-select data-ng-model="contact.CompanyId" theme="bootstrap" name="CompanyId" ng-disabled="!companies.length" required>\n                    <ui-select-match placeholder="{{ \'APPLICATION_COMPANY\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                    <ui-select-choices repeat="company.id as company in companies | filter: $select.search" null-option="scope.noCompany">\n                      <div ng-bind-html="company.name | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span class="input-group-btn">\n                    <button type="button" data-ng-click="companyInfo(contact.CompanyId)" class="btn btn-default" data-ng-disabled="!contact.CompanyId">\n                      <span class="icon-info" data-ng-class="{\'font-blue\':contact.CompanyId}"></span>\n                    </button>\n                  </span>\n                </div>\n                <div class="note note-warning" data-ng-hide="companies.length">\n                  <h4 class="block">Warning!</h4>\n                  <p>\n                    {{ \'MESSAGE_NO_COMPANIES_AVAILABLE\' | translate }}\n                  </p>\n                  <p>\n                    {{\'APPLICATION_GO_TO\' | translate}} <a href="/contactmanager/companies/list">{{\'APPLICATION_COMPANIES\' | translate}}</a>\n                  </p>\n                </div>\n                <span data-ng-show="forms.general.CompanyId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COMPANY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START PHONE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$invalid}">\n                <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}</label>\n                <div class="input-group">\n                  <input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="contact.phone"/>\n                  <span class="input-group-btn" uib-dropdown>\n                    <button data-ng-if="Auth.isAgent()" type="button" uib-dropdown-toggle class="btn btn-default" data-ng-disabled="!contact.phone || !agent.phoneBarRemoteControl" >\n                      <span class="icon-earphones-alt" data-ng-class="{\'font-blue\':contact.phone && agent.phoneBarRemoteControl}" uib-tooltip="{{!agent.phoneBarRemoteControl ? (\'APPLICATION_ENABLE_REMOTE_PHONEBAR\' | translate) : (\'APPLICATION_MOTION_BAR_CONTROLS\' | translate)}}" ></span>\n                    </button>\n                    <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">\n                      <li role="menuitem"><a href="#" data-ng-click="callPhoneBar(contact.phone,\'call\')"><i class="icon-phone"></i> {{\'APPLICATION_CALL\' | translate}}</a></li>\n                      <li role="menuitem"><a href="#" data-ng-click="callPhoneBar(contact.phone,\'transfer\')"><i class="glyphicon glyphicon-random"></i> {{\'APPLICATION_TRANSFER\' | translate}}</a></li>\n                    </ul>\n                    <button type="button" data-ng-click="openRoom(null,\'smsRoom\',{to:contact.phone})" class="btn btn-default" data-ng-disabled="!contact.phone || !license.messaging">\n                      <span class="glyphicon glyphicon-comment" data-ng-class="{\'font-blue\':contact.phone && license.messaging}"></span>\n                    </button>\n                  </span>\n                </div>\n                <span data-ng-show="(forms.general.phone.$touched || forms.general.$submitted) && forms.general.phone.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END PHONE -->\n              <!-- START MOBILE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$invalid}">\n                <label class="control-label">{{\'APPLICATION_MOBILE\' | translate}}</label>\n                <div class="input-group">\n                  <input type="text" name="mobile" placeholder="{{\'APPLICATION_MOBILE\' | translate}}" class="form-control" data-ng-model="contact.mobile"/>\n                  <span class="input-group-btn" uib-dropdown>\n                    <button data-ng-if="Auth.isAgent()" type="button" uib-dropdown-toggle class="btn btn-default" data-ng-disabled="!contact.mobile || !agent.phoneBarRemoteControl" >\n                      <span class="icon-earphones-alt" data-ng-class="{\'font-blue\':contact.mobile && agent.phoneBarRemoteControl}" uib-tooltip="{{!agent.phoneBarRemoteControl ? (\'APPLICATION_ENABLE_REMOTE_PHONEBAR\' | translate) : (\'APPLICATION_MOTION_BAR_CONTROLS\' | translate)}}" ></span>\n                    </button>\n                    <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">\n                      <li role="menuitem"><a href="#" data-ng-click="callPhoneBar(contact.mobile,\'call\')"><i class="icon-phone"></i> {{\'APPLICATION_CALL\' | translate}}</a></li>\n                      <li role="menuitem"><a href="#" data-ng-click="callPhoneBar(contact.mobile,\'transfer\')"><i class="glyphicon glyphicon-random"></i> {{\'APPLICATION_TRANSFER\' | translate}}</a></li>\n                    </ul>\n                    <button type="button" data-ng-click="openRoom(null,\'smsRoom\',{to:contact.mobile})" class="btn btn-default" data-ng-disabled="!contact.mobile || !license.messaging">\n                      <span class="glyphicon glyphicon-comment" data-ng-class="{\'font-blue\':contact.mobile && license.messaging}"></span>\n                    </button>\n                  </span>\n                </div>\n                <span data-ng-show="(forms.general.mobile.$touched || forms.general.$submitted) && forms.general.mobile.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END MOBILE -->\n              <!-- START EMAIL -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$invalid}">\n                <label class="control-label">{{\'APPLICATION_EMAIL\' | translate}}</label>\n                <div class="input-group">\n                  <input type="text" name="email" placeholder="{{\'APPLICATION_EMAIL\' | translate}}" class="form-control" data-ng-model="contact.email"/>\n                  <span class="input-group-btn">\n                    <button type="button" data-ng-click="openRoom(null,\'mailRoom\',{to:contact.email})" class="btn btn-default" data-ng-disabled="!contact.email || !license.mail">\n                      <span class="icon-envelope" data-ng-class="{\'font-blue\':contact.email && license.mail}"></span>\n                    </button>\n                  </span>\n                </div>\n                <span data-ng-show="(forms.general.email.$touched || forms.general.$submitted) && forms.general.email.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END EMAIL -->\n            </div>\n            <div class="col-md-4">\n              <!-- START FAX -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$invalid}">\n                <label class="control-label">{{\'APPLICATION_FAX\' | translate}}</label>\n                <div class="input-group">\n                  <input type="text" name="fax" placeholder="{{\'APPLICATION_FAX\' | translate}}" class="form-control" data-ng-model="contact.fax"/>\n                  <span class="input-group-btn">\n                    <button type="button" data-ng-click="openRoom(null,\'faxRoom\',{to:contact.fax})" class="btn btn-default" data-ng-disabled="!contact.fax || !license.fax">\n                      <span class="icon-paper-plane" data-ng-class="{\'font-blue\':contact.fax && license.fax}"></span>\n                    </button>\n                  </span>\n                </div>\n                <span data-ng-show="(forms.general.fax.$touched || forms.general.$submitted) && forms.general.fax.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END FAX -->\n              <!-- START TAGS -->\n              <div class="form-group" data-ng-class="{\'has-error\': forms.general.tags.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_TAGS\' | translate}}</label>\n                <ui-select multiple=\'true\' data-ng-model="contact.tags" theme="bootstrap" name="tags" ng-disabled="disabled">\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                <span data-ng-show="forms.general.tags.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END TAGS -->\n              <!-- START LIST -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                <input type="text" name="list" placeholder="{{\'APPLICATION_LIST\' | translate}}" class="form-control" data-ng data-ng-model="contact.List.name" disabled/>\n              </div>\n              <!-- END LIST -->\n              <!-- START LIST -->\n              <div data-ng-if="!contact.id" class="form-group" data-ng-class="{\'has-error\': forms.general.ListId.$invalid && forms.general.$submitted}">\n                <label class="control-label">{{\'APPLICATION_LIST\' | translate}}</label>\n                <ui-select data-ng-model="contact.ListId" theme="bootstrap" name="ListId" data-ng-change="getCustomFields()" required>\n                  <ui-select-match placeholder="{{ \'APPLICATION_LIST\' | translate }}">{{$select.selected.name}}</ui-select-match>\n                  <ui-select-choices repeat="list.id as list in lists | filter: $select.search">\n                    <div ng-bind-html="list.name | highlight: $select.search"></div>\n                  </ui-select-choices>\n                </ui-select>\n                <div class="note note-warning" data-ng-hide="lists.length">\n                  <h4 class="block">Warning!</h4>\n                  <p>\n                    {{ \'MESSAGE_NO_LISTS_AVAILABLE\' | translate }}\n                  </p>\n                  <p>\n                    {{\'APPLICATION_GO_TO\' | translate}} <a href="/contactmanager/lists/list">{{\'APPLICATION_LISTS\' | translate}}</a>\n                  </p>\n                </div>\n                <span data-ng-show="forms.general.ListId.$invalid && forms.general.$submitted" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END LIST -->\n            </div>\n            </div>\n            <div data-ng-class="{\'hidden\':detail.tab != \'other\'}" class="portlet-body contact-portlet row">\n              <div class="col-md-4">\n              <!-- START STREET -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$invalid}">\n                <label class="control-label">{{\'APPLICATION_STREET\' | translate}}</label>\n                <input type="text" name="street" placeholder="{{\'APPLICATION_STREET\' | translate}}" class="form-control" data-ng-model="contact.street"/>\n                <span data-ng-show="(forms.general.street.$touched || forms.general.$submitted) && forms.general.street.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END STREET -->\n\n              <!-- START POSTALCODE -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$invalid}">\n                <label class="control-label">{{\'APPLICATION_POSTALCODE\' | translate}}</label>\n                <input type="text" name="postalCode" placeholder="{{\'APPLICATION_POSTALCODE\' | translate}}" class="form-control" data-ng-model="contact.postalCode"/>\n                <span data-ng-show="(forms.general.postalCode.$touched || forms.general.$submitted) && forms.general.postalCode.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END POSTALCODE -->\n\n              <!-- START CITY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$invalid}">\n                <label class="control-label">{{\'APPLICATION_CITY\' | translate}}</label>\n                <input type="text" name="city" placeholder="{{\'APPLICATION_CITY\' | translate}}" class="form-control" data-ng-model="contact.city"/>\n                <span data-ng-show="(forms.general.city.$touched || forms.general.$submitted) && forms.general.city.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END CITY -->\n            </div>\n            <div class="col-md-4">\n              <!-- START COUNTRY -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$invalid}">\n                <label class="control-label">{{\'APPLICATION_COUNTRY\' | translate}}</label>\n                <input type="text" name="country" placeholder="{{\'APPLICATION_COUNTRY\' | translate}}" class="form-control" data-ng-model="contact.country"/>\n                <span data-ng-show="(forms.general.country.$touched || forms.general.$submitted) && forms.general.country.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END COUNTRY -->\n\n              <!-- START DATEOFBIRTH -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$invalid}">\n                <label class="control-label">{{\'APPLICATION_DATEOFBIRTH\' | translate}}</label>\n                <input name="dateOfBirth" type="date" placeholder="{{\'APPLICATION_DATEOFBIRTH\' | translate}}" class="form-control date-picker" data-ng-model="contact.dateOfBirth"/>\n                <span data-ng-show="(forms.general.dateOfBirth.$touched || forms.general.$submitted) && forms.general.dateOfBirth.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END DATEOFBIRTH -->\n\n              <!-- START DESCRIPTION -->\n              <div class="form-group">\n                <label class="control-label">{{\'APPLICATION_DESCRIPTION\' | translate}}</label>\n                <textarea style="resize: vertical;" type="text" name="description" placeholder="{{\'APPLICATION_DESCRIPTION\' | translate}}" class="form-control" data-ng-model="contact.description"></textarea>\n              </div>\n              <!-- END DESCRIPTION -->\n            </div>\n            <div class="col-md-4">\n              <!-- START URL -->\n              <div class="form-group" data-ng-class="{\'has-error\': (forms.general.url.$touched || forms.general.$submitted) && forms.general.url.$invalid}">\n                <label class="control-label">{{\'APPLICATION_URL\' | translate}}</label>\n                <input type="text" name="url" placeholder="{{\'APPLICATION_URL\' | translate}}" class="form-control" data-ng-model="contact.url"/>\n                <span data-ng-show="(forms.general.url.$touched || forms.general.$submitted) && forms.general.url.$error.required" class="help-block help-block-error">\n                  <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                </span>\n              </div>\n              <!-- END URL -->\n\n              <!-- START CREATED_BY -->\n              <div class="form-group" data-ng-if="contact.id">\n                <label class="control-label">{{\'APPLICATION_CREATED_BY\' | translate}}</label>\n                <input type="text" name="createdBy" placeholder="{{\'APPLICATION_CREATED_BY\' | translate}}" class="form-control" data-ng-model="contact.User.name" disabled/>\n              </div>\n              <!-- END CREATED_BY -->\n            </div>\n            </div>\n            </div>\n            <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName || !contact.ListId">{{\'APPLICATION_UPDATE\' | translate}}</button>\n          </div>\n          <!-- END PORTLET -->\n          <!-- BEGIN PORTLET -->\n          <div class="portlet light" data-ng-if="customFields.length">\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_CUSTOM_FIELDS\' | translate}}</span>\n              </div>\n            </div>\n            <div class="portlet-body">\n              <div class="row">\n              <div class="col-md-4" data-ng-repeat="customField in customFields">\n                <div data-ng-if="customField.type==\'text\'" class="form-group" data-ng-class="{\'has-error\': (forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$invalid}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <input type="text" name="{{customField.name}}" placeholder="{{customField.alias}}" class="form-control" data-ng-model="contact[customField.name]"/>\n                  <span data-ng-show="(forms.general[customField.name].$touched || forms.general.$submitted) && forms.general[customField.name].$error.required" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n                <div data-ng-if="customField.type==\'select\'" class="form-group" data-ng-class="{\'has-error\': forms.general[customField.name].$invalid && forms.general.$submitted}">\n                  <label class="control-label">{{customField.alias}}</label>\n                  <ui-select data-ng-model="contact[customField.name]" theme="bootstrap" name="{{customField.name}}" data-ng-disabled="disabled">\n                    <ui-select-match allow-clear placeholder="{{customField.alias}}">{{$select.selected.value}}</ui-select-match>\n                    <ui-select-choices repeat="choice.value as choice in customField.values | filter: $select.search">\n                      <div ng-bind-html="choice.value | highlight: $select.search"></div>\n                    </ui-select-choices>\n                  </ui-select>\n                  <span data-ng-show="forms.general[customField.name].$invalid && forms.general.$submitted" class="help-block help-block-error">\n                    <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                  </span>\n                </div>\n              </div>\n            </div>\n              <button type="submit" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!contact.firstName || !contact.ListId">{{\'APPLICATION_UPDATE\' | translate}}</button>\n            </div>\n        </div>\n        <!-- END PORTLET -->\n      </div>\n      <div class="tab-pane fade" id="tab_1_2{{contact.id || \'\'}}">\n          <!-- BEGIN PORTLET -->\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_CUSTOMER_JOURNEY\' | translate}}</span>\n              </div>\n              <ul class="nav nav-tabs">\n                <li class="active">\n                  <a href="#" data-target="#tab_2_1" data-toggle="tab">{{ \'APPLICATION_DAILY\' | translate}}</a>\n                </li>\n                <li>\n                  <a href="#" data-target="#tab_2_2" data-toggle="tab">{{ \'APPLICATION_HISTORY\' | translate}}</a>\n                </li>\n              </ul>\n            </div>\n            <div class="portlet-body">\n              <!--BEGIN TABS-->\n              <div class="tab-content">\n                <div class="tab-pane active" id="tab_2_1">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.show === \'phone\'}" data-ng-click="updateLog(\'daily\',\'phone\',\'general\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_PHONES\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.show === \'email\'}" data-ng-click="updateLog(\'daily\',\'email\',\'general\',\'room\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_EMAILS\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.show === \'chat\'}" data-ng-click="updateLog(\'daily\',\'chat\',\'general\',\'room\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_CHAT\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.show === \'fax\'}" data-ng-click="updateLog(\'daily\',\'fax\',\'general\',\'room\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_FAX\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.show === \'sms\'}" data-ng-click="updateLog(\'daily\',\'sms\',\'general\',\'room\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_SMS\' | translate}}</label>\n                      </div><span data-ng-if="log.daily.show==\'phone\'"> |</span>\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.daily.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.type === \'inbound\'}" data-ng-click="updateLog(\'daily\',false,false,\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_INBOUND\' | translate}}</label>\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.type === \'outbound\'}" data-ng-click="updateLog(\'daily\',false,\'general\',\'outbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_OUTBOUND\' | translate}}</label>\n                      </div><span data-ng-if="log.daily.show==\'phone\'"> |</span>\n                      <div class="btn-group btn-group-devided" data-toggle="buttons" data-ng-if="log.daily.show==\'phone\'">\n                        <label class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.detail === \'general\'}" data-ng-click="updateLog(\'daily\',false,\'general\',false)">\n                        <input type="radio" class="toggle">{{\'APPLICATION_GENERAL\' | translate}}</label>\n                        <label data-ng-if="log.daily.type===\'inbound\'" class="btn btn-transparent grey-salsa btn-circle btn-sm" data-ng-class="{\'active\':log.daily.detail === \'queue\'}" data-ng-click="updateLog(\'daily\',false,\'queue\',\'inbound\')">\n                        <input type="radio" class="toggle">{{\'APPLICATION_QUEUES\' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if="gridOptionsdaily" name="gridOptionsdaily"  ui-grid="gridOptionsdaily"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-exporter ui-grid-draggable-rows class="ui-grid">\n                      <div class="watermark" ng-show="!gridOptionsdaily.data.length">{{\'MESSAGE_NO_RESULTS_AVAILABLE\' | translate}}</div>\n                    </div>\n                  </div>\n              </div>\n                <div class="tab-pane" id="tab_2_2">\n                  <div class="contact-portlet">\n                    <div class="actions">\n                      <div class="btn-group btn-group-devided" data-toggle="buttons">\n'+"                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.show === 'phone'}\" data-ng-click=\"updateLog('history','phone','general','inbound')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_PHONES' | translate}}</label>\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.show === 'email'}\" data-ng-click=\"updateLog('history','email','general','room')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_EMAILS' | translate}}</label>\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.show === 'chat'}\" data-ng-click=\"updateLog('history','chat','general','room')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_CHAT' | translate}}</label>\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.show === 'fax'}\" data-ng-click=\"updateLog('history','fax','general','room')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_FAX' | translate}}</label>\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.show === 'sms'}\" data-ng-click=\"updateLog('history','sms','general','room')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_SMS' | translate}}</label>\n                      </div><span data-ng-if=\"log.history.show=='phone'\"> |</span>\n                      <div class=\"btn-group btn-group-devided\" data-toggle=\"buttons\" data-ng-if=\"log.history.show=='phone'\">\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.type === 'inbound'}\" data-ng-click=\"updateLog('history',false,false,'inbound')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_INBOUND' | translate}}</label>\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.type === 'outbound'}\" data-ng-click=\"updateLog('history',false,'general','outbound')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_OUTBOUND' | translate}}</label>\n                      </div><span data-ng-if=\"log.history.show=='phone'\"> |</span>\n                      <div class=\"btn-group btn-group-devided\" data-toggle=\"buttons\" data-ng-if=\"log.history.show=='phone'\">\n                        <label class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.detail === 'general'}\" data-ng-click=\"updateLog('history',false,'general',false)\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_GENERAL' | translate}}</label>\n                        <label data-ng-if=\"log.history.type==='inbound'\" class=\"btn btn-transparent grey-salsa btn-circle btn-sm\" data-ng-class=\"{'active':log.history.detail === 'queue'}\" data-ng-click=\"updateLog('history',false,'queue','inbound')\">\n                        <input type=\"radio\" class=\"toggle\">{{'APPLICATION_QUEUES' | translate}}</label>\n                      </div>\n                    </div>\n                    <div data-ng-if=\"gridOptionshistory\" name=\"gridOptionshistory\" ui-grid=\"gridOptionshistory\"  ui-grid-resize-columns ui-grid-auto-resize ui-grid-pagination ui-grid-exporter ui-grid-draggable-rows class=\"ui-grid\">\n                      <div class=\"watermark\" ng-show=\"!gridOptionshistory.data.length\">{{'MESSAGE_NO_RESULTS_AVAILABLE' | translate}}</div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n              <!--END TABS-->\n            </div>\n          </div>\n          <!-- END PORTLET -->\n        </div>\n    <!-- END PROFILE CONTENT -->\n  </form>\n</div>\n  </div>\n</div>\n"),
 a.put("app/main/template/template.jscriptyTab.html",'<div class="portlet light bordered">\n    <!-- BEGIN PORTLET BODY -->\n    <div class="portlet-body">\n          <div class="row">\n              <!-- BEGIN SIDEBAR -->\n                <div  class="profile-sidebar" style="width: 250px;">\n                  <!-- PORTLET MAIN -->\n                                         <!-- SIDEBAR MENU -->\n                                         <div class="profile-usermenu">\n                                                <ul class="nav">\n                                                              <li  ng-repeat= \'question in questions track by $index\' ng-class="{active: $index == count}">\n                                                               <a  ng-click="setCurrentQuestion($index)" >\n                                                                                                                           <i class="fa fa-check"></i> <label ng-if="attribute.nodeName == \'label\'" ng-repeat=\'attribute in question.value.attributes track by $index\'>{{attribute.value}}</label>\n                            </a>\n                                                         </li>\n                                                 </ul>\n                                         </div>\n                                        <!-- END SIDEBAR MENU -->\n                    <!-- END PORTLET MAIN -->\n                </div>\n                  <!-- END SIDEBAR -->\n                  <div   class="profile-content">\n                        <div class="portlet light bordered">\n                          <div class="portlet-title">\n                            <div class="caption font-green-sharp">\n                              <i class="fa fa-edit font-green-sharp"></i>\n                              <span ng-if="attribute.nodeName ==\'label\'" ng-repeat=\'attribute in currentQuestion.value.attributes\' class="caption-subject">{{attribute.value}} </span>\n                            </div>\n\n                          </div>\n                                                                               <div class="portlet-body form ">\n                            <div class="row">\n                                                                                                                   <div class="col-md-10 col-md-offset-1 ">\n                                  <form >\n                                    <div class="form-body" style="height: 400px; overflow-y: auto;overflow-x:hidden">\n\n                                       <!-- Question  -->\n                                       <div class="form-group" style="word-wrap: break-word;" >\n                                          <h3 ng-if="attribute.nodeName ==\'question\' || attribute.nodeName ==\'text\'" ng-repeat=\'attribute in currentQuestion.value.attributes\'>{{attribute.value}}</h3>\n                                        </div>\n                                        <!-- Buttons  -->\n\n                                        <div  ng-if ="(edge.source.id == currentQuestion.id) && edge.value" ng-repeat=\'edge in currentQuestion.edges track by $index\' class="row">\n                                          <div  class="col-md-8 col-md-offset-2">\n                                            <input    checked="checked"   type="radio"  ng-model="currentQuestion.button" ng-value="edge" >\n                                              <label  ng-show="(edge.source.id == currentQuestion.id) && edge.value">{{edge.value}}</label><br><br>\n                                          </div>\n                                        </div>\n                                               <!-- Question Other Option  -->\n\n                                         <div class="form-group" ng-if= "attribute.nodeName ==\'other\' && attribute.value " ng-repeat=\'attribute in currentQuestion.value.attributes track by $index\'>\n                                            <br>\n                                           <div class="col-md-2">\n                                             <label class="control-label">{{attribute.value}}</label>\n                                           </div>\n                                              <div class="col-md-8">\n                                                <textarea  style="overflow:auto" ng-model="currentQuestion.otheranswer" placeholder="Enter text" rows="8" cols="40" ></textarea>\n                                              </div>\n                                                                                                                   </div>\n                                              <!--  Inputs -->\n                                          <div class="row margin-top-10"  ng-repeat=\'question in currentQuestion.children track by $index\'>\n                                              <div class="col-md-10 col-md-offset-1">\n                                                <div  ng-repeat=\'attribute in question.value.attributes track by $index\'>\n                                                    <div  ng-switch="attribute.nodeName">\n                                                        <div ng-class="col-md-2" ng-switch-when="label">\n                                                          <label class="control-label" style=" display:block;word-break:break-all;" >{{attribute.value}}</label>\n                                                        </div>\n                                                        <div ng-class="attribute.value != \'checkbox\' ? \'col-md-10 pull-right\': \'col-md-2\'" ng-switch-when="type" ng-switch="attribute.value">\n                                                            <input class="form-control" ng-switch-when="text" type="text" ng-model="question.answer" />\n                                                            <input  class="form-control" ng-switch-when="number" type="number" ng-model="question.answer" />\n                                                            <input  class=" pull-right"  ng-switch-when="checkbox" type="checkbox" ng-model="question.answer" />\n                                                            <!-- ng-true-value="\'Selected\'" ng-false-value="\'Not Selected\'" -->\n                                                            <textarea  class="form-control" ng-switch-when="textarea" ng-model="question.answer" rows="8" cols="40"></textarea>\n                                                        </div>\n                                                    </div>\n                                                </div>\n                                              </div>\n                                          </div>\n                                          </div>\n                                          <!-- actions -->\n                                          <div class="form-actions">\n                                            <div  ng-switch="attribute.nodeName" class="btn-set pull-left">\n                                              <button class="btn red-haze "  ng-click="end()">\n                                                <span  class="fa fa-times" > Close</span>\n                                              </button>\n                                              <!-- <button class="btn red-haze "  ng-click="end()">\n                                                <span ng-if="attribute.nodeName ==\'end\'" ng-repeat=\'attribute in currentQuestion.value.attributes\' class="fa fa-times" > Finish</span>\n                                              </button> -->\n                                              <button class="btn blue-haze"  ng-show="count" ng-click="back()"><span class="glyphicon glyphicon-chevron-left"></span>Back</button>\n                                            </div>\n                                            <div class="btn-set pull-right">\n                                              <button  ng-show=" currentQuestion.button" class="btn blue-hoki"   ng-click="next(currentQuestion.button.target, currentQuestion.button.value)">Next<span class="glyphicon glyphicon-chevron-right" ></span></button>\n                                              <button ng-repeat=\'edge in currentQuestion.edges track by $index\' ng-show="(edge.source.id == currentQuestion.id) && !edge.value" class="btn blue-hoki"   ng-click="next(edge.target)">Next<span class="glyphicon glyphicon-chevron-right" ></span></button>\n                                            </div>\n                                          </div>\n                                      </form>\n                                  </div>\n                                </div>\n                            </div>\n                        </div>\n                 </div>\n        </div>\n  </div>\n  <!-- END PORTLET BODY -->\n</div>\n'),a.put("app/main/template/template.notification.html",'<div class="ui-notification alert alert-block" ng-class="class" style="width: 350px; margin-top: 50px;">\n  <h4 ng-show="title" class="alert-heading"><i class="{{icon}}"></i> {{title}}</h4>\n  <hr>\n  <p ng-bind-html="message"></p>\n  <br>\n  <p>\n    <a class="btn btn-success close-notification" href="#" ng-click="nAccept()"><i class="glyphicon glyphicon-ok"></i> {{acceptBtn}} </a>\n    <a class="btn btn-danger close-notification" href="#" ng-click="nReject()"><i class="glyphicon glyphicon-remove"></i> {{rejectBtn}} </a>\n  </p>\n</div>\n'),a.put("app/main/template/template.reportBuilderView.html",'<div class="alert alert-warning alert-group">\n        <div class="form-inline" data-ng-class="{\'has-error\': forms.report.$submitted && !group.rules.length}">\n            <select ng-options="o.name as o.name for o in operators" ng-model="group.operator" class="form-control input-sm"></select>\n            <button style="margin-left: 5px" type="button" ng-click="addCondition()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_CONDITION\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="addGroup()" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus-sign"></span> {{\'APPLICATION_ADD_GROUP\' | translate}}</button>\n            <button style="margin-left: 5px" type="button" ng-click="removeGroup()" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-minus-sign"></span> {{\'APPLICATION_REMOVE_GROUP\' | translate}}</button>\n        </div>\n        <div class="group-conditions">\n            <div ng-repeat="rule in group.rules | orderBy:\'index\'" class="condition">\n                <div ng-switch="rule.hasOwnProperty(\'group\')">\n                    <div ng-switch-when="true">\n                        <report-builder group="rule.group" fields="fields" forms="forms"></report-builder>\n                    </div>\n                    <div ng-switch-default="ng-switch-default">\n                        <div class="row">\n                          <div class="col-md-2" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.field}">\n                          <ui-select data-ng-model="rule.field" theme="bootstrap" dynamic-name="randomName()" required>\n                            <ui-select-match placeholder="" ><span ng-bind-html="$select.selected.name"></span></ui-select-match>\n                            <ui-select-choices repeat="field.value as field in fields | filter: $select.search">\n                              <div ng-bind-html="field.name | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                          <span data-ng-show="forms.report.$submitted && !rule.field" class="help-block help-block-error">\n                            <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                          </span>\n                        </div>\n                        <div class="col-md-1">\n                          <ui-select data-ng-model="rule.condition" theme="bootstrap" dynamic-name="randomName()" data-ng-change="inputIsRequired(rule)" data-ng-init="inputIsRequired(rule)">\n                            <ui-select-match placeholder="">{{$select.selected.name}}</ui-select-match>\n                            <ui-select-choices repeat="condition.name as condition in conditions | filter: $select.search">\n                              <div ng-bind-html="condition.name | highlight: $select.search"></div>\n                            </ui-select-choices>\n                          </ui-select>\n                        </div>\n                          <div class="col-md-2" data-ng-class="{\'has-error\': forms.report.$submitted && !rule.value}" data-ng-if="rule.required">\n                            <input type="text" ng-model="rule.value" class="form-control" dynamic-name="randomName()" data-ng-required="requiredInput"/>\n                            <span data-ng-show="forms.report.$submitted && !rule.value" class="help-block help-block-error">\n                                                                                                                        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n                                                                                                         </span>\n                          </div>\n                            <button style="margin-left: 5px" ng-click="removeCondition($index)" class="btn btn-sm btn-danger" type="button"><span class="glyphicon glyphicon-minus-sign"></span></button>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n'),a.put("app/main/template/template.tigerDialDisposal.html",'<div class="row margin-top-20 contact-tab-container">\n  <div class="portlet light bordered">\n    <div class="portlet-title">\n      <div class="caption font-blue-hoki">\n        <span class="caption-subject">{{ workspace.spooler.calleridname }} {{ \'APPLICATION_MOTION_DIALER\' | translate }} {{ \'APPLICATION_DISPOSITION\' | translate }} </span>\n      </div>\n    </div>\n    <div class="portlet-body">\n      <div class="padding-bottom row">\n        <div class="col-md-12" data-ng-form="tdForm">\n          <!-- START RETRIEVE -->\n          <div class="form-group" data-ng-class="{\'has-error\': (tdForm.retrieve.$touched || tdForm.$submitted) && tdForm.retrieve.$invalid}">\n            <label class="control-label">RETRIEVE<span class="required" aria-required="true">*</span></label>\n            <select name="retrieve" class="form-control" data-ng-model="entitySpooler.retrieve" required>\n              <option value="CLOSED">CLOSE</option>\n              <option value="OPEN">OPEN</option>\n              <option value="BLACK_LIST">BLACKLIST</option>\n              <option value="PLANNED">PLANNING</option>\n              <option value="PLANNED_PEER">PLANNING AGENT</option>\n            </select>\n            <span data-ng-show="(tdForm.retrieve.$touched || tdForm.$submitted) && tdForm.retrieve.$error.required" class="help-block help-block-error">\n              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n            </span>\n          </div>\n          <!-- END RETRIEVE -->\n          <!-- START PLANNING DATE -->\n          <div class="form-group" data-ng-if="entitySpooler.retrieve == \'PLANNED\' || entitySpooler.retrieve == \'PLANNED_PEER\'" data-ng-class="{\'has-error\': (tdForm.date.$touched || tdForm.$submitted) && tdForm.date.$invalid}">\n            <label class="control-label">PLANNING DATE<span class="required" aria-required="true">*</span></label>\n            <uib-datepicker name="date" ng-model="entitySpooler.planningtime" required="entitySpooler.retrieve == \'PLANNED\' || entitySpooler.retrieve == \'PLANNED_PEER\'" data-ng-init="entitySpooler.planningtime = moment();"></uib-datepicker>\n            <span data-ng-show="(tdForm.date.$touched || tdForm.$submitted) && tdForm.date.$error.required" class="help-block help-block-error">\n              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n            </span>\n          </div>\n          <!-- END PLANNING DATE -->\n          <!-- START PLANNING TIME -->\n          <div class="form-group" data-ng-if="entitySpooler.retrieve == \'PLANNED\' || entitySpooler.retrieve == \'PLANNED_PEER\'" data-ng-class="{\'has-error\': (tdForm.time.$touched || tdForm.$submitted) && tdForm.time.$invalid}">\n            <label class="control-label">PLANNING TIME<span class="required" aria-required="true">*</span></label>\n            <uib-timepicker name="time" ng-model="entitySpooler.planningtime" required="entitySpooler.retrieve == \'PLANNED\' || entitySpooler.retrieve == \'PLANNED_PEER\'" show-meridian="false" show-seconds="false"></uib-timepicker>\n            <span data-ng-show="(tdForm.time.$touched || tdForm.$submitted) && tdForm.time.$error.required" class="help-block help-block-error">\n              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n            </span>\n          </div>\n          <!-- END PLANNING TIME -->\n          <!-- START PLANNING PEER -->\n          <div class="form-group" data-ng-if="entitySpooler.retrieve == \'PLANNED_PEER\'" data-ng-class="{\'has-error\': (tdForm.agent.$touched || tdForm.$submitted) && tdForm.agent.$invalid}">\n            <label class="control-label">{{\'APPLICATION_AGENT\' | translate}}<span class="required" aria-required="true">*</span></label>\n            <select name="agent" class="form-control" data-ng-model="entitySpooler.planningpeer" ng-options="agent for agent in agents" required="entitySpooler.retrieve == \'PLANNED_PEER\'">\n            </select>\n            <span data-ng-show="(tdForm.agent.$touched || tdForm.$submitted) && tdForm.agent.$error.required" class="help-block help-block-error">\n              <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n            </span>\n          </div>\n          <!-- END PLANNING PEER -->\n          <button type="button" class="btn btn-circle green-haze btn-sm" data-ng-disabled="!tdForm.$valid" data-ng-click="save()">{{\'APPLICATION_SAVE\' | translate}}</button>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n'),a.put("app/market/market.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-handbag"></i>\n                                          <a href="/market">Market Place</a>\n          </li>\n        </ul>\n                    </div>\n                </div>\n</div>\n<!-- BEGIN PAGE CONTENT-->\n<div class="row" data-ng-init="initView()">\n  <div class="col-md-12">\n    <!-- Our Integration -->\n    <div class="headline">\n      <h3>Our Integrations</h3>\n    </div>\n    <div class="row thumbnails" data-ng-repeat="group in groupedIntegration">\n      <div class="col-md-3" data-ng-repeat="integration in group">\n        <div class="our-integrations">\n          <h3> {{integration.name}} <small> {{integration.author}}</small></h3>\n          <img data-ng-src="{{integration.logo}}" alt="{{integration.name}}" class="img-responsive"/>\n          <div class="integration-info" data-ng-if="!integration.downloading">\n            <p>\n              {{integration.description}}\n            </p>\n            <div class="pull-right">\n                  <a data-ng-disabled="isProgressing" data-ng-if="!integration.active" data-ng-click="installIntegration(integration)" href="#" class="btn btn-xs green-meadow">Install <i class="fa fa-download"></i></a>\n                                                  <a data-ng-disabled="isProgressing" data-ng-if="integration.active" data-ng-click="uninstallIntegration(integration)" href="#" class="btn btn-xs red-sunglo">Uninstall <i class="fa fa-trash"></i></a>\n                    <a href="{{integration.link}}" class="btn btn-xs grey-cascade" target="_blank">More <i class="fa fa-link"></i></a>\n            </div>\n          </div>\n                                  <div class="integration-info" data-ng-if="integration.downloading">\n                                           <div>\n                                                 <uib-progressbar class="progress-striped active" value="percentage" type="success"><i style="color:black;">{{status}}</i></uib-progressbar>\n                                           </div>\n          </div>\n        </div>\n      </div>\n                </div>\n    <!--/thumbnails-->\n    <!-- //End Meer Our Team -->\n  </div>\n</div>\n'),a.put("app/motiondialer/blacklist/list/list.create.modal.html",'<div class="modal-header">\n  <h3 class="modal-title">{{ \'APPLICATION_NEW_CONTACT\' | translate }}</h3>\n</div>\n<div class="modal-body">\n  <form name="form" novalidate>\n\n    <!-- START PHONE -->\n    <div class="form-group" data-ng-class="{\'has-error\': (form.phone.$touched || form.$submitted) && form.phone.$invalid}">\n      <label class="control-label">{{\'APPLICATION_PHONE\' | translate}}<span class="required" aria-required="true">*</span></label>\n      <input type="text" name="phone" placeholder="{{\'APPLICATION_PHONE\' | translate}}" class="form-control" data-ng-model="item.phone" required/>\n      <span data-ng-show="(form.phone.$touched || form.$submitted) && form.phone.$error.required" class="help-block help-block-error">\n        <strong>{{\'APPLICATION_WARNING\' | translate}}!</strong> {{\'MESSAGE_REQUIRED_FIELD\' | translate}}.\n      </span>\n    </div>\n    <!-- END PHONE -->\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="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/motiondialer/blacklist/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-control-forward"></i>\n                                  <a href="#">Motion Dialer</a>\n                                 <i class="fa fa-angle-right"></i>\n                             </li>\n        <li>\n          <i class="icon-doc"></i>\n          <a href="#">{{ \'APPLICATION_BLACKLIST\' | 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-doc font-green-sharp"></i>\n                                     <span class="caption-subject">{{ \'APPLICATION_BLACKLIST\' | translate }}</a> </span>\n                         </div>\n                                <div class="actions">\n                                 <div class="btn-group">\n                                               <button class="btn green-jungle " ng-click="createItem()">\n                                                    <i class="icon-plus"></i> {{ \'APPLICATION_NEW_CONTACT\' | translate }}\n                                               </button>\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-exporter 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/motiondialer/info/view/view.about.html",'<div class="row" data-ng-init="initView()">\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_ABOUT\' | translate}}</span>\n                          </div>\n                        </div>\n                        <div class="portlet-body">\n        <form class="form-horizontal form-row-seperated">\n          <div class="form-body">\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Specification</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.SpecificationTitle}} ({{properties.SpecificationVersion}}) - {{properties.SpecificationVendor}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Implementation</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.ImplementationTitle}} ({{properties.ImplementationVersion}}) - {{properties.ImplementationVendor}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Start Time</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.StartTime" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Uptime</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.Uptime" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Operating System</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.OsName}} {{properties.OsVersion}} {{properties.OsArch}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Processors</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.Processors" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">System Start Time</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.SystemStartTime" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">System Uptime</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.SystemUptime" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">File System</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="Usable: {{properties.FileSystem.Usable | number:2}} Free: {{properties.FileSystem.Free | number:2}} Total: {{properties.FileSystem.Total | number:2}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n          </div>\n        </form>\n                   </div>\n                </div>\n        </div>\n</div>\n'),a.put("app/motiondialer/info/view/view.details.html",'<div class="row" data-ng-init="initView()">\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_DETAILS\' | translate}}</span>\n                                </div>\n                        </div>\n                        <div class="portlet-body">\n        <form class="form-horizontal form-row-seperated">\n          <div class="form-body">\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Java Specification Name</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.JavaSpecificationName" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Java Home</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" data-ng-model="properties.JavaHome" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">JavaVm</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.JavaVmName}} ({{properties.JavaVmVersion}} {{properties.JavaVmInfo}}) - {{properties.JavaVmVendor}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Java</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="Java ({{properties.JavaVersion}} {{properties.JavaClassVersion}}) - {{properties.JavaVendor}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Java Runtime</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.JavaRuntimeName}} ({{JavaRuntimeVersion}})" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Java Rmi Server Hostname</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.JavaRmiServerHostname}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">User</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.UserName}} {{properties.UserLanguage}}-{{properties.UserCountry}} {{properties.UserTimezone}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">User Home</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.UserHome}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n            <!-- START -->\n            <div class="form-group">\n              <label class="control-label col-md-3">Hostname</label>\n              <div class="col-md-9">\n                <input type="text" class="form-control" value="{{properties.Hostname}}" disabled/>\n                <span class="help-block">\n                </span>\n              </div>\n            </div>\n            <!-- END -->\n          </div>\n        </form>\n                        </div>\n                </div>\n        </div>\n</div>\n'),
index e91252b..21800a5 100644 (file)
@@ -50,7 +50,7 @@
     <![endif]-->
     <script src="app/cf8af6fa.vendor.js"></script>
 
-    <script src="app/4089734f.app.js"></script>
+    <script src="app/7cbb6696.app.js"></script>
 
     <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
     <!-- BEGIN CORE PLUGINS -->
index d71ea6c..9f0d0da 100644 (file)
@@ -1,31 +1,5 @@
 # xCALLY MOTION Changelog
 
-- * 49fe26d - 2016-09-13: move socket dashboard 
-- * 4eae3b4 - 2016-09-13: Added emitter to scheduler service 
-- * 9270b6b - 2016-09-13: Fixed triggers with emitter; Fixed agi. 
-- * 5fb560b - 2016-09-13: server side config/ami + config/tools update 
-- * 51d6d3e - 2016-09-13: server side update 
-- * 9750695 - 2016-09-13: fix duplicate events 
-- * 0cbc254 - 2016-09-13: server side models interval + user 
-- * 0c84ddb - 2016-09-13: sever side update tools + app.js 
-- * f8ce2ee - 2016-09-13: automation chat update (server side - emitter) 
-- * 7a3e5af - 2016-09-13: automation fax update (server side - emitter) automation mail update (server side - code clean) 
-- * e49ba5d - 2016-09-13: automation mail update (server side - emitter) 
-- * 22e90bb - 2016-09-13: Log removed 
-- * 4b2abca - 2016-09-13: Added cluster emitter to agi service 
-- * 5daed3e - 2016-09-13: server side model cluster emitter 
-- * 448ae9a - 2016-09-13: server side config/ami update cluster emitter 
-- * a7fe2de - 2016-09-13: server side config/ami update 
-- * c2f5ff5 - 2016-09-13: server side config ami + models 
-- * 106ec0a - 2016-09-13: server side update 
-- * 54fe652 - 2016-09-13: Disabled queue create and update for users 
-- * e21693b - 2016-09-13: Fixed tour with user permissions check 
-- * c7931e0 - 2016-09-13: package.json 
-- * 6c4c360 - 2016-09-13: server side app.js 
-- * 1fb29d8 - 2016-09-13: server side config/ami update raw queries 
-- * d65fe81 - 2016-09-13: server side utils/report_extraction.js 
-- * fe2b3a6 - 2016-09-13: server side config/routes.js 
-- * 81cdca2 - 2016-09-13: server side config/agi update 
 - * 815d4b0 - 2016-09-13: client side channels update 
 - * 576be79 - 2016-09-12: fixed routing chat behavior 
 - * ce3bfcb - 2016-09-12: Insert canned answer at the cursor when composing mail; Updated angular ckeditor. 
index 48b9b5b..ecfb13e 100644 (file)
@@ -12,12 +12,12 @@ router.get('/', license.isValidDate(), license.hasChat(), auth.isAuthenticated()
 router.get('/me', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.me);
 router.get('/:id/agents', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.showAgents);
 router.get('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.show);
-router.post('/', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.create);
-router.post('/:id/agents', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.addAgents);
-router.put('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.update);
-router.delete('/:id/agents', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.removeAgents);
-router.patch('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.update);
-router.delete('/', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.bulkDestroy);
-router.delete('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasRole('admin'), controller.destroy);
+router.post('/', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.create);
+router.post('/:id/agents', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.addAgents);
+router.put('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.update);
+router.delete('/:id/agents', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.removeAgents);
+router.patch('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.update);
+router.delete('/', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.bulkDestroy);
+router.delete('/:id', license.isValidDate(), license.hasChat(), auth.isAuthenticated(), auth.hasModule([8], ['admin']), controller.destroy);
 
 module.exports = router;
index 0e5f100..9f1fac3 100644 (file)
@@ -3,19 +3,18 @@
 var express = require('express');
 var controller = require('./fax_queue.controller');
 var auth = require('../../auth/auth.service');
-var license = require('../../config/license/license.service');
 
 var router = express.Router();
 
-router.get('/', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasModule([10], ['admin']), controller.index);
-router.get('/:id', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasModule([10], ['admin']), controller.show);
-router.get('/:id/agents', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasModule([10], ['admin']), controller.showAgents);
-router.post('/', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.create);
-router.post('/:id/agents', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.addAgents);
-router.put('/:id', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.update);
-router.patch('/:id', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.update);
-router.delete('/', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.bulkDestroy);
-router.delete('/:id', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.destroy);
-router.delete('/:id/agents', license.isValidDate(), license.hasFax(), auth.isAuthenticated(), auth.hasRole('admin'), controller.removeAgents);
+router.get('/', auth.isAuthenticated(), controller.index);
+router.get('/:id', auth.isAuthenticated(), controller.show);
+router.get('/:id/agents', auth.isAuthenticated(), controller.showAgents);
+router.post('/', auth.isAuthenticated(), controller.create);
+router.post('/:id/agents', auth.isAuthenticated(), controller.addAgents);
+router.put('/:id', auth.isAuthenticated(), controller.update);
+router.patch('/:id', auth.isAuthenticated(), controller.update);
+router.delete('/', auth.isAuthenticated(), controller.bulkDestroy);
+router.delete('/:id', auth.isAuthenticated(), controller.destroy);
+router.delete('/:id/agents', auth.isAuthenticated(), controller.removeAgents);
 
 module.exports = router;
index 16acbca..89fd8d9 100644 (file)
@@ -11,11 +11,11 @@ var router = express.Router();
 router.get('/', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.index);
 router.get('/:id', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.show);
 router.get('/:id/agents', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.showAgents);
-router.post('/', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.create);
-router.post('/:id/agents', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.addAgents);
-router.put('/:id', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.update);
-router.delete('/', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.bulkDestroy);
-router.delete('/:id', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.destroy);
-router.delete('/:id/agents', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasRole('admin'), controller.removeAgents);
+router.post('/', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.create);
+router.post('/:id/agents', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.addAgents);
+router.put('/:id', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.update);
+router.delete('/', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.bulkDestroy);
+router.delete('/:id', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.destroy);
+router.delete('/:id/agents', license.isValidDate(), license.hasMail(), auth.isAuthenticated(), auth.hasModule([9], ['admin']), controller.removeAgents);
 
 module.exports = router;
index a85e598..65d3d56 100644 (file)
@@ -8,15 +8,15 @@ var license = require('../../config/license/license.service');
 var router = express.Router();
 
 // router.get('/', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.index);
-router.get('/', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.index);
-router.get('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.show);
-router.get('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.showAgents);
-router.post('/', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.create);
-router.post('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.addAgents);
-router.put('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.update);
-router.patch('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.update);
-router.delete('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.destroy);
-router.delete('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.removeAgents);
-router.delete('/', license.isValidDate(), auth.isAuthenticated(), license.hasOpenchannel(), auth.hasRole('admin'), controller.bulkDestroy);
+router.get('/', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.index);
+router.get('/:id', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.show);
+router.get('/:id/agents', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.showAgents);
+router.post('/', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.create);
+router.post('/:id/agents', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.addAgents);
+router.put('/:id', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.update);
+router.patch('/:id', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.update);
+router.delete('/:id', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.destroy);
+router.delete('/:id/agents', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.removeAgents);
+router.delete('/', auth.isAuthenticated(), license.hasOpenchannel(), auth.hasModule([20], ['admin']), controller.bulkDestroy);
 
 module.exports = router;
index 2033118..6c638b3 100644 (file)
@@ -7,15 +7,15 @@ var license = require('../../config/license/license.service');
 
 var router = express.Router();
 
-router.get('/', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.index);
-router.get('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.show);
-router.get('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.showAgents);
-router.post('/', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.create);
-router.post('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.addAgents);
-router.put('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.update);
-router.patch('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.update);
-router.delete('/:id', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.destroy);
-router.delete('/:id/agents', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.removeAgents);
-router.delete('/', license.isValidDate(), auth.isAuthenticated(), license.hasSms(), auth.hasRole('admin'), controller.bulkDestroy);
+router.get('/', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.index);
+router.get('/:id', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.show);
+router.get('/:id/agents', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.showAgents);
+router.post('/', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.create);
+router.post('/:id/agents', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.addAgents);
+router.put('/:id', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.update);
+router.patch('/:id', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.update);
+router.delete('/:id', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.destroy);
+router.delete('/:id/agents', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.removeAgents);
+router.delete('/', auth.isAuthenticated(), license.hasSms(), auth.hasModule([11], ['admin']), controller.bulkDestroy);
 
 module.exports = router;
index dbb3e29..f3a4806 100644 (file)
@@ -70,100 +70,89 @@ exports.update = function(req, res, next) {
   if (req.body.id) {
     delete req.body.id;
   }
-  // return sequelize.transaction(function(t) {
-  return Trigger
-    .findById(req.params.id)
-    .then(function(trigger) {
-      _trigger = trigger;
-      if (req.body.Any) {
-        return ToolsCondition
-          .destroy({
-            where: {
-              TriggerAnyId: req.params.id
-            }
-            // ,
-            // transaction: t
-          });
-      }
-      return;
-    })
-    .then(function() {
-      if (req.body.Any && Array.isArray(req.body.Any) && req.body.Any.length) {
-        _.forEach(req.body.Any, function(elem) {
-          elem.TriggerAnyId = req.params.id;
-        });
-        return ToolsCondition
-          .bulkCreate(req.body.Any
-            //   , {
-            //   transaction: t
-            // }
-          );
-      }
-      return;
-    })
-    .then(function() {
-      if (req.body.All) {
-        return ToolsCondition
-          .destroy({
-            where: {
-              TriggerAllId: req.params.id
-            }
-            // ,
-            // transaction: t
-          });
-      }
-      return;
-    })
-    .then(function() {
-      if (req.body.All && Array.isArray(req.body.All) && req.body.All.length) {
-        _.forEach(req.body.All, function(elem) {
-          elem.TriggerAllId = req.params.id;
-        });
-        return ToolsCondition
-          .bulkCreate(req.body.All
-            //   , {
-            //   transaction: t
-            // }
-          );
-      }
-      return;
-    })
-    .then(function() {
-      if (req.body.Actions) {
-        return ToolsAction
-          .destroy({
-            where: {
-              TriggerId: req.params.id
-            }
-            // ,
-            // transaction: t
-          });
-      }
-      return;
-    })
-    .then(function() {
-      if (req.body.Actions && Array.isArray(req.body.Actions) && req.body.Actions.length) {
-        _.forEach(req.body.Actions, function(elem) {
-          elem.TriggerId = req.params.id;
+  return sequelize.transaction(function(t) {
+      return Trigger
+        .findById(req.params.id)
+        .then(function(trigger) {
+          _trigger = trigger;
+          if (req.body.Any) {
+            return ToolsCondition
+              .destroy({
+                where: {
+                  TriggerAnyId: req.params.id
+                },
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          if (req.body.Any && Array.isArray(req.body.Any) && req.body.Any.length) {
+            _.forEach(req.body.Any, function(elem) {
+              elem.TriggerAnyId = req.params.id;
+            });
+            return ToolsCondition
+              .bulkCreate(req.body.Any, {
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          if (req.body.All) {
+            return ToolsCondition
+              .destroy({
+                where: {
+                  TriggerAllId: req.params.id
+                },
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          if (req.body.All && Array.isArray(req.body.All) && req.body.All.length) {
+            _.forEach(req.body.All, function(elem) {
+              elem.TriggerAllId = req.params.id;
+            });
+            return ToolsCondition
+              .bulkCreate(req.body.All, {
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          if (req.body.Actions) {
+            return ToolsAction
+              .destroy({
+                where: {
+                  TriggerId: req.params.id
+                },
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          if (req.body.Actions && Array.isArray(req.body.Actions) && req.body.Actions.length) {
+            _.forEach(req.body.Actions, function(elem) {
+              elem.TriggerId = req.params.id;
+            });
+            return ToolsAction
+              .bulkCreate(req.body.Actions, {
+                transaction: t
+              });
+          }
+          return;
+        })
+        .then(function() {
+          var updated = _.merge(_trigger, req.body);
+          return updated
+            .save({
+              transaction: t
+            });
         });
-        return ToolsAction
-          .bulkCreate(req.body.Actions
-            //   , {
-            //   transaction: t
-            // }
-          );
-      }
-      return;
-    })
-    .then(function() {
-      var updated = _.merge(_trigger, req.body);
-      return updated
-        .save(
-          //   {
-          //   transaction: t
-          // }
-        );
-      // });
     })
     .then(function() {
       return res.sendStatus(200);
index 0d6efa4..c27c4a6 100644 (file)
@@ -29,90 +29,85 @@ var util = require('util');
 var crypto = require('crypto');
 var cronjob = require('cron').CronJob;
 var shelljs = require('shelljs/global');
-var sticky = require('sticky-session');
 
 var express = require('express');
+var models = require('./models');
 var config = require('./config/environment');
 
-var sio = require('socket.io');
-var sio_redis = require('socket.io-redis');
-
 // Setup server
 var app = express();
-var server = http.createServer(app);
-
-if (!sticky.listen(server, config.port)) {
-  console.log('master');
-
-  var models = require('./models');
-  var ami = require('asterisk-manager')(config.asterisk.port,
-    config.asterisk.host,
-    config.asterisk.username,
-    config.asterisk.password,
-    true);
-
-  ami.keepConnected();
-
-  models
-    .sequelize
-    .sync()
-    .then(function() {
-      // Populate DB Develop with sample data
-      if (config.seedDB) {
-        require('./config/seed');
-      }
-      // Populate DB Production with sample data
-      if (config.seedPDB) {
-        require('./config/seedp');
-      }
-
-      // Start Cally Square Projects
-      require('./config/automations/mail')();
-      require('./config/automations/fax')();
-      require('./config/automations/chat')();
-      require('./config/triggers')(ami);
-      require('./config/ami')(ami); // dani
-      require('./config/scheduler')();
-      require('./config/imap')(); // dani
-      require('./config/smtp')() // dani
-      require('./config/sms')(); // andre
-      require('./config/chat')(); // andre
-      require('./config/openchannel')();
-      require('./config/tools')(); // dani
-      require('./config/agi')();
-      require('./config/license')(); // no hooks
-      require('./services/dashboard')();
-    })
-    .then(function() {
-      // Connect to database history
-      return models
-        .sequelize_history
-        .sync();
-    })
-    .then(function() {
-      require('./config/history/history')(cronjob);
-    })
-    .catch(function(err) {
-      console.error(err);
-    });
-} else {
-  console.log('slave');
-  // Slave code
-  require('./config/express')(app);
-  require('./routes')(app);
-
-  var io = sio(server, {
-    serveClient: (config.env === 'production') ? false : true,
-    path: '/socket.io-client'
-  });
+var server = require('http').createServer(app);
+
+var io = require('socket.io')(server, {
+  serveClient: (config.env === 'production') ? false : true,
+  path: '/socket.io-client'
+});
+var redis = require('socket.io-redis');
+io.adapter(redis({
+  host: config.ip,
+  port: 6379
+}));
+
+var ami = require('asterisk-manager')(config.asterisk.port,
+  config.asterisk.host,
+  config.asterisk.username,
+  config.asterisk.password,
+  true);
+
+ami.keepConnected();
 
-  io.adapter(sio_redis({
-    host: config.ip,
-    port: 6379
-  }));
+require('./config/express')(app);
+require('./routes')(app, ami);
 
-  require('./config/socketio')(io);
-}
+models
+  .sequelize
+  .sync()
+  .then(function() {
+
+    // Populate DB Develop with sample data
+
+    if (config.seedDB) {
+      require('./config/seed');
+    }
+    // Populate DB Production with sample data
+    if (config.seedPDB) {
+      require('./config/seedp');
+    }
+
+    // Start Cally Square Projects
+    require('./config/socketio')(io, require('./services/dashboard')(io));
+    require('./config/automations/mail')();
+    require('./config/automations/fax')();
+    require('./config/automations/chat')();
+    require('./config/triggers')(ami);
+    require('./config/scheduler')();
+    require('./config/imap')();
+    require('./config/smtp')()
+    require('./config/sms')();
+    require('./config/chat')();
+    require('./config/openchannel')();
+    require('./config/tools')();
+    require('./config/ami')(ami);
+    require('./config/agi')();
+    require('./config/license')();
+
+    // Start server
+    server.listen(config.port, config.ip, function() {
+      console.log('Express server listening on %d, in %s mode', config.port, app.get('env'));
+    });
+  })
+  .then(function() {
+    // Connect to database history
+    return models
+      .sequelize_history
+      .sync();
+  })
+  .then(function() {
+    require('./config/history/history')(cronjob);
+  })
+  .catch(function(err) {
+    console.error(err);
+  });
 
 // Expose app
 exports = module.exports = app;
index 6514c00..589efd2 100644 (file)
@@ -686,8 +686,7 @@ methods.record = function(context, vertex, callback) {
     length: 4
   });
   console.log('Starting call recording...');
-  context.send(util.format('RECORD FILE %s %s "%s" %s %s %s %s\n', path.join(config.root, 'server/files/recordings', context.uniqueid + '_' + saveName), vertex.recordingFormat || 'wav', vertex.escape_digits,
-      vertex.timeout * 1000, null, true, null),
+  context.send(util.format('RECORD FILE %s %s "%s" %s %s %s %s\n', path.join(config.root, 'server/files/recordings', context.uniqueid + '_' + saveName), vertex.recordingFormat || 'wav', vertex.escape_digits, vertex.timeout * 1000, null, true, null),
     function(
       err, res) {
       if (res.code === 200 && res.result !== '-1') {
@@ -705,8 +704,6 @@ methods.record = function(context, vertex, callback) {
             saveName: context.uniqueid + '_' + saveName,
             filename: vertex.file || null,
             savePath: path.join(config.root, 'server/files/recordings', context.uniqueid + '_' + saveName + '.wav')
-          }, {
-            raw: true
           })
           .catch(function(err) {
             console.log('Error saving ' + vertex.tag + ':' + vertex.label + ' block log', err);
@@ -1752,7 +1749,7 @@ function getUsers(synch) {
   return User
     .findAll()
     .then(function(result) {
-      collections.users = _.map(result, 'dataValues');
+      collections.users = _.clone(result);
       if (synch) {
         synchUpdates('User', 'users', 'id');
       }
@@ -1766,7 +1763,7 @@ function getQueues(synch) {
   return VoiceQueue
     .findAll()
     .then(function(result) {
-      collections.queues = _.map(result, 'dataValues');
+      collections.queues = _.clone(result);
       if (synch) {
         synchUpdates('VoiceQueue', 'queues', 'name');
       }
@@ -1780,7 +1777,7 @@ function getVariables(synch) {
   return Variable
     .findAll()
     .then(function(result) {
-      collections.variables = _.map(result, 'dataValues');
+      collections.variables = _.clone(result);
       if (synch) {
         synchUpdates('Variable', 'variables', 'id');
       }
@@ -1794,7 +1791,7 @@ function getDbConnections(synch) {
   return SquareOdbc
     .findAll()
     .then(function(result) {
-      collections.dbConnections = _.map(result, 'dataValues');
+      collections.dbConnections = _.clone(result);
       if (synch) {
         synchUpdates('SquareOdbc', 'dbConnections', 'id');
       }
@@ -1808,7 +1805,7 @@ function getIntervals(synch) {
   return Interval
     .findAll()
     .then(function(result) {
-      collections.intervals = _.map(result, 'dataValues');
+      collections.intervals = _.clone(result);
       if (synch) {
         synchUpdates('Interval', 'intervals');
       }
@@ -1822,7 +1819,7 @@ function getProjects(synch) {
   return SquareProject
     .findAll()
     .then(function(result) {
-      collections.projects = _.map(result, 'dataValues');
+      collections.projects = _.clone(result);
       if (synch) {
         synchUpdates('SquareProject', 'projects', 'id');
       }
@@ -1836,7 +1833,7 @@ function getSounds(synch) {
   return Sound
     .findAll()
     .then(function(result) {
-      collections.sounds = _.map(result, 'dataValues');
+      collections.sounds = _.clone(result);
       if (synch) {
         synchUpdates('Sound', 'sounds', 'id');
       }
@@ -1850,7 +1847,7 @@ function getMailServerOut(synch) {
   return MailServerOut
     .findAll()
     .then(function(result) {
-      collections.mailServerOut = _.map(result, 'dataValues');
+      collections.mailServerOut = _.clone(result);
       if (synch) {
         synchUpdates('MailServerOut', 'mailServerOut', 'id');
       }
@@ -1864,7 +1861,7 @@ function getTemplates(synch) {
   return Template
     .findAll()
     .then(function(result) {
-      collections.templates = _.map(result, 'dataValues');
+      collections.templates = _.clone(result);
       if (synch) {
         synchUpdates('Template', 'templates', 'id');
       }
@@ -1878,7 +1875,7 @@ function getSmsAccounts(synch) {
   return SmsAccount
     .findAll()
     .then(function(result) {
-      collections.smsAccounts = _.map(result, 'dataValues');
+      collections.smsAccounts = _.clone(result);
       if (synch) {
         synchUpdates('SmsAccount', 'smsAccounts', 'id');
       }
index a88b659..b2c8a79 100644 (file)
@@ -1,7 +1,6 @@
 var cp = require('child_process');
 var util = require('util');
 var models = require('../../models');
-var emitter = require('cluster-emitter');
 
 module.exports = function() {
   var child = cp
@@ -23,18 +22,14 @@ module.exports = function() {
         case 'create':
           delete data.message;
           return models.ReportSquare
-            .create(data, {
-              raw: true
-            })
+            .create(data)
             .catch(function(err) {
               console.log('Error saving enter time for IVR', err);
             });
         case 'detail':
           delete data.message;
           return models.ReportSquareDetail
-            .create(data, {
-              raw: true
-            })
+            .create(data)
             .catch(function(err) {
               console.log('Error saving ' + data.application + ':' + data.node + ' block log', err);
             });
@@ -75,7 +70,7 @@ module.exports = function() {
 
 function synchCollection(data, child) {
   var condition = {};
-  emitter.on(data.model + '.afterCreate', function(doc) {
+  models[data.model].afterCreate(function(doc) {
     condition[data.key] = doc[data.key];
     child.send({
       message: 'updateCollection',
@@ -84,7 +79,7 @@ function synchCollection(data, child) {
       doc: doc
     });
   });
-  emitter.on(data.model + '.afterUpdate', function(doc) {
+  models[data.model].afterUpdate(function(doc) {
     condition[data.key] = doc[data.key];
     child.send({
       message: 'updateCollection',
@@ -93,7 +88,7 @@ function synchCollection(data, child) {
       doc: doc
     });
   });
-  emitter.on(data.model + '.afterDestroy', function(doc) {
+  models[data.model].afterDestroy(function(doc) {
     condition[data.key] = doc[data.key];
     child.send({
       message: 'removeFromCollection',
@@ -104,13 +99,14 @@ function synchCollection(data, child) {
 }
 
 function replaceCollection(data, child) {
-  emitter.on(data.model + '.afterCreate', function(doc) {
+  var condition = {};
+  models[data.model].afterCreate(function(doc) {
     getCollection(data, child, doc);
   });
-  emitter.on(data.model + '.afterUpdate', function(doc) {
+  models[data.model].afterUpdate(function(doc) {
     getCollection(data, child, doc);
   });
-  emitter.on(data.model + '.afterDestroy', function(doc) {
+  models[data.model].afterDestroy(function(doc) {
     getCollection(data, child, doc);
   });
 }
index eb36673..44a3ba4 100644 (file)
@@ -1,11 +1,15 @@
+/**
+ * Broadcast updates to client when the model changes
+ */
+
 'use strict';
 
 var moment = require('moment');
 var util = require('util');
 var Promise = require('bluebird');
-var emitter = require('cluster-emitter');
 
 var Agent = require('../../models').User;
+var _Action = require('../../models').Action;
 var Sequelize = require('../../models').sequelize;
 var VoiceQueue = require('../../models').VoiceQueue;
 var ReportMember = require('../../models').ReportMember;
@@ -20,11 +24,11 @@ function Action(ami) {
   console.log('Action Initialization...');
   var channels = ['voice', 'chat', 'mail', 'fax', 'sms', 'openchannel'];
 
-  emitter.on('Action.afterCreate', function(doc, options) {
+  _Action.afterCreate(function(doc, options) {
     return onSave(doc, options, ami);
   });
 
-  emitter.on('ReportMember.beforeCreate', function(doc, options) {
+  ReportMember.beforeCreate(function(doc, options) {
     return ReportMember
       .findAll({
         where: {
index b62591f..f634adc 100644 (file)
@@ -1,19 +1,14 @@
-'use strict';
-
-var util = require('util');
 var moment = require('moment');
-var emitter = require('cluster-emitter');
-
 var _ = require('lodash');
 var VoiceQueue = require('../../models').VoiceQueue;
 var Agent = require('../../models').User;
 var Action = require('../../models').Action;
 var ReportAgent = require('../../models').ReportAgent;
-
 var _voiceQueues;
 var _agents;
 var activeAcw = {};
 
+
 function ACW(ami) {
   console.log('ACW Initialization...');
   VoiceQueue
@@ -30,8 +25,7 @@ function ACW(ami) {
       _agents = agents;
       // console.log('_agents', _.map(_agents, 'dataValues'));
       synchCollection(Agent, _agents, 'id');
-
-      emitter.on(util.format('%s.%s', 'Action', 'afterDestroy'), function(doc, options) {
+      Action.afterCreate(function(doc, options) {
         return onSave(doc, options);
       });
     })
@@ -58,9 +52,8 @@ function onSave(doc, options) {
           uniqueid: activeAcw[options.body.agent].uniqueid,
           destuniqueid: activeAcw[options.body.agent].destuniqueid
         },
-        // transaction: options.transaction,
-        individualHooks: true,
-        raw: true
+        transaction: options.transaction,
+        individualHooks: true
       })
       .catch(function(err) {
         console.log(err);
@@ -91,8 +84,7 @@ ACW.prototype.agentcomplete = function(evt) {
         body: {
           agent: agent.id,
           type: 'ACW'
-        },
-        raw: true
+        }
       })
       .then(function() {
         console.log('PAUSED BY ACW');
@@ -118,8 +110,7 @@ ACW.prototype.agentcomplete = function(evt) {
               body: {
                 agent: agent.id,
                 type: 'ACW'
-              },
-              raw: true
+              }
             })
             .catch(function(err) {
               console.log(err);
@@ -134,17 +125,15 @@ ACW.prototype.agentcomplete = function(evt) {
 
 function synchCollection(model, array, uniqueProperty) {
   var condition = {};
-  emitter.on(util.format('%s.%s', model, 'afterCreate'), function(doc, options) {
+  model.afterCreate(function(doc) {
     condition[uniqueProperty] = doc[uniqueProperty]
     updateCollection(array, doc, condition);
   });
-
-  emitter.on(util.format('%s.%s', model, 'afterUpdate'), function(doc, options) {
+  model.afterUpdate(function(doc) {
     condition[uniqueProperty] = doc[uniqueProperty]
     updateCollection(array, doc, condition);
   });
-
-  emitter.on(util.format('%s.%s', model, 'afterDestroy'), function(doc, options) {
+  model.afterDestroy(function(doc) {
     condition[uniqueProperty] = doc[uniqueProperty]
     _.remove(array, condition);
   });
index 18616dd..4a7d5e4 100644 (file)
@@ -67,10 +67,8 @@ Agent.prototype.callerabandon = function(evt) {
 
 function createAgent(evt) {
   return ReportAgent
-    .create(evt, {
-      raw: true
-    })
-    .then(function() {
+    .create(evt)
+    .then(function(agent) {
       console.log('[report] agent begin created');
     })
     .catch(function(err) {
@@ -85,10 +83,9 @@ function updateAgents(evt, where) {
         uniqueid: evt.uniqueid,
         destuniqueid: evt.destuniqueid
       },
-      individualHooks: true,
-      raw: true
+      individualHooks: true
     })
-    .then(function() {
+    .then(function(agent) {
       console.log('[agent] agent')
     })
     .catch(function(err) {
index f655c32..addcd41 100644 (file)
@@ -22,6 +22,7 @@ function create(evt) {
       defaults: evt
     })
     .spread(function(call, created) {
+      console.log('call', call);
       if (!created) {
 
         if (evt.answertime) {
index 1bd77f8..eb6ed61 100644 (file)
@@ -50,10 +50,8 @@ Dial.prototype.hangup = function(evt) {
 
 function createDial(evt) {
   return ReportDial
-    .create(evt, {
-      raw: true
-    })
-    .then(function() {
+    .create(evt)
+    .then(function(dial) {
       console.log('[dial] begin')
     })
     .catch(function(err) {
@@ -72,12 +70,10 @@ function updateDial(evt, where) {
     .then(function(row) {
       if (row) {
         return row
-          .updateAttributes(evt, {
-            raw: true
-          });
+          .updateAttributes(evt);
       }
     })
-    .then(function() {
+    .then(function(dial) {
       console.log('[dial] update')
     })
     .catch(function(err) {
index 61b4076..7bc697b 100644 (file)
@@ -1,13 +1,9 @@
-'use stict';
-
 var fs = require('fs');
 var util = require('util');
 var path = require('path');
 var config = require('../../config/environment');
 var _ = require('lodash');
 var Promise = require('bluebird');
-var emitter = require('cluster-emitter');
-
 // var tiff2pdf = Promise.promisify(require('tiff2pdf'));
 var exec = require('child-process-promise').exec;
 var fse = require('fs-extra');
@@ -29,13 +25,13 @@ var faxaccounts;
 function Fax(ami) {
   console.log('Fax Initialization...');
 
-  emitter.on('FaxMessage.afterCreate', function(doc, options) {
-    sendfax(doc, ami, 0, options);
+  FaxMessage.afterCreate(function(doc, opt) {
+    sendfax(doc, ami, 0, opt);
   });
 
-  emitter.on('FaxMessage.afterUpdate', function(doc, options) {
+  FaxMessage.afterUpdate(function(doc, opt) {
     if (doc.changed('status') && doc.status === 'SENDING') {
-      sendfax(doc, ami, doc.retry + 1, options);
+      sendfax(doc, ami, doc.retry + 1, opt);
     }
   });
 
@@ -44,8 +40,7 @@ function Fax(ami) {
     .then(function(accounts) {
       faxaccounts = accounts;
       synch(faxaccounts);
-
-      emitter.on('ReportFax.afterUpdate', function(doc, options) {
+      ReportFax.afterUpdate(function(doc) {
         var account = _.find(faxaccounts, {
           id: parseInt(doc.accountid)
         });
@@ -56,15 +51,14 @@ function Fax(ami) {
           webhook(doc, account, 'reject');
         }
       });
-
-      emitter.on('FaxRoom.afterUpdate', function(doc, options) {
+      FaxRoom.afterUpdate(function(doc) {
         var account = _.find(faxaccounts, {
           id: doc.FaxAccountId
         });
         if (account && doc.changed('status') && doc.status === 'CLOSED') {
           webhook(doc, account, 'close');
         }
-      });
+      })
     })
     .catch(function(err) {
       console.error(err);
@@ -72,11 +66,10 @@ function Fax(ami) {
 }
 
 function synch(faxaccounts) {
-  emitter.on('FaxAccount.afterCreate', function(doc) {
+  FaxAccount.afterCreate(function(doc) {
     faxaccounts.push(doc);
   });
-
-  emitter.on('FaxAccount.afterUpdate', function(doc, options) {
+  FaxAccount.afterUpdate(function(doc) {
     var oldItem = _.find(faxaccounts, {
       id: doc.id
     });
@@ -87,12 +80,12 @@ function synch(faxaccounts) {
       faxaccounts.unshift(doc);
     }
   });
-
-  emitter.on('FaxAccount.afterDestroy', function(doc) {
+  FaxAccount.afterDestroy(function(doc) {
     _.remove(faxaccounts, {
       id: doc.id
     });
   });
+
 }
 
 function webhook(doc, account, hook) {
@@ -129,16 +122,16 @@ function webhook(doc, account, hook) {
 }
 
 function execRequest(doc, method, url) {
-  return Util
-    .sendRequest(doc, method, url)
+  Util.sendRequest(doc, method, url)
     .then(function(values) {
       console.log('request successeful!');
+
     })
     .catch(function(err) {
       console.log('request failed!');
+
     })
 }
-
 Fax.prototype.updateError = function(evt) {
   return FaxMessage
     .findOne({
@@ -549,6 +542,8 @@ function sendfax(message, ami, retry, opt) {
   }
 }
 
+
+
 function getFaxRoom(_fMessage) {
   return function(account) {
     if (_fMessage.FaxRoomId) {
index 3a93399..70a48c4 100644 (file)
@@ -174,6 +174,7 @@ module.exports = function(ami) {
 
   // Raised when a caller abandons the queue.
   ami.on('queuecallerabandon', function(evt) {
+    console.log('abandon evt', evt);
     queuecaller.abandon(evt);
     //queuemember.callerabandon(evt);
     user.queueStatusUpdate('complete', evt);
index 07afd3f..22bba44 100644 (file)
@@ -65,10 +65,8 @@ Member.prototype.outboundComplete = function(evt) {
 
 function createMember(evt) {
   return ReportMember
-    .create(evt, {
-      raw: true
-    })
-    .then(function() {
+    .create(evt)
+    .then(function(agent) {
       console.log('[report] member talking created');
     })
     .catch(function(err) {
@@ -83,15 +81,15 @@ function updateMember(where) {
     })
     .then(function(member) {
       if (member) {
-        return member
-          .updateAttributes({
-            exitAt: moment().format("YYYY-MM-DD HH:mm:ss"),
-            duration: moment.duration(moment() - moment(member.enterAt)).asSeconds()
-          }, {
-            raw: true
-          });
+        return member.updateAttributes({
+          exitAt: moment().format("YYYY-MM-DD HH:mm:ss"),
+          duration: moment.duration(moment() - moment(member.enterAt)).asSeconds()
+        });
       }
     })
+    // .then(function() {
+    //   console.log('[report] member outbound talking updated');
+    // })
     .catch(function(err) {
       console.error('[report] member ' + err);
     });
index 279b015..1e23db2 100644 (file)
@@ -1,28 +1,21 @@
-'use strict';
-
-const _ = require('lodash');
-const util = require('util');
-const path = require('path');
-const emitter = require('cluster-emitter');
-const fs = require('fs');
-
 var NetwokModel = require('../../models').Network;
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
 var config = require('../../config/environment');
+var _ = require('lodash');
 
 function Network(ami) {
   console.log('Network Initialization...');
-
-  emitter.on('Network.afterCreate', function(doc) {
+  NetwokModel.afterCreate(function(doc) {
     networkRewrite(doc, ami);
-  });
-
-  emitter.on('Network.afterUpdate', function(doc) {
+  })
+  NetwokModel.afterUpdate(function(doc) {
     networkRewrite(doc, ami);
-  });
-
-  emitter.on('Network.afterDelete', function(doc) {
+  })
+  NetwokModel.afterDelete(function(doc) {
     networkRewrite(doc, ami);
-  });
+  })
 }
 
 function networkRewrite(doc, ami) {
index bc200c2..a143290 100644 (file)
@@ -44,9 +44,7 @@ QueueCaller.prototype.exit = function(evt) {
 
 function create(evt) {
   return ReportQueue
-    .create(evt, {
-      raw: true
-    })
+    .create(evt)
     .then(function(queue) {
       console.log('[report] queue created');
     })
index 2162be6..ae6bed4 100644 (file)
@@ -20,9 +20,7 @@ function create(evt) {
   evt.type = 'unknown';
   evt.customerPhone = evt.calleridnum;
   return VoiceRecording
-    .create(evt, {
-      raw: true
-    })
+    .create(evt)
     .catch(function(err) {
       console.error('Recording create error:', err);
     });
@@ -36,8 +34,7 @@ function updateQueue(evt) {
     }, {
       where: {
         uniqueid: evt.uniqueid
-      },
-      raw: true
+      }
     })
     .catch(function(err) {
       console.error('Recording queue update error:', err);
@@ -55,8 +52,7 @@ function updateType(evt) {
       if (recording) {
         recording.type = evt.type;
         recording.customerPhone = evt.type === 'outbound' ? recording.exten : recording.calleridnum;
-        return recording
-          .save();
+        return recording.save();
       }
     })
     .catch(function(err) {
diff --git a/server/config/ami/socket.js b/server/config/ami/socket.js
new file mode 100644 (file)
index 0000000..0a82a2b
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * Broadcast updates to client when the model changes
+ */
+
+'use strict';
+
+function Socket(socket, ami) {
+  console.log('New socket connection');
+
+  var ReportAgent = require('../../models').ReportAgent;
+
+  return {
+    test: function () {
+      console.log('test');
+    }
+  }
+}
+
+module.exports = Socket;
index 9e41ba4..057c9a0 100644 (file)
@@ -7,10 +7,8 @@ function Transfer() {
 
 Transfer.prototype.createBlind = function(evt) {
   return ReportCallTransfer
-    .create(evt, {
-      raw: true
-    })
-    .then(function() {
+    .create(evt)
+    .then(function(member) {
       console.log('[blind tranfer] created');
     })
     .catch(function(err) {
index 7d0d166..764f6e0 100644 (file)
@@ -1,9 +1,5 @@
-'use strict';
-
 var TrunkModel = require('../../models').Trunk;
-
 var fs = require('fs');
-var emitter = require('cluster-emitter');
 var util = require('util');
 var path = require('path');
 var config = require('../../config/environment');
@@ -11,22 +7,19 @@ var _ = require('lodash');
 
 function Trunk(ami) {
   console.log('Trunk Initialization...');
-
-  emitter.on('Trunk.afterCreate', function(doc) {
+  TrunkModel.afterCreate(function(doc) {
     if (doc.active) {
       trunksRewrite(doc, ami, false);
     }
-  });
-
-  emitter.on('Trunk.afterUpdate', function(doc) {
-    if (doc.active) {
+  })
+  TrunkModel.afterUpdate(function(doc) {
+    if (!doc.changed('status') && !doc.changed('peerstatus') && !doc.changed('updatedAt')) {
       trunksRewrite(doc, ami, false);
     }
-  });
-
-  emitter.on('Trunk.afterDestroy', function(doc) {
+  })
+  TrunkModel.afterDelete(function(doc) {
     trunksRewrite(doc, ami, true);
-  });
+  })
 }
 
 Trunk.prototype.statusUpdate = function(evt) {
@@ -48,8 +41,7 @@ Trunk.prototype.statusUpdate = function(evt) {
           }
         }]
       },
-      individualHooks: true,
-      raw: true
+      individualHooks: true
     })
     .catch(function(err) {
       console.log('Trunk status update error:', err);
@@ -64,8 +56,7 @@ Trunk.prototype.peerstatusUpdate = function(evt) {
       where: {
         name: evt.peer.split('/')[1],
       },
-      individualHooks: true,
-      raw: true
+      individualHooks: true
     })
     .catch(function(err) {
       console.log('Trunk peerstatus update error:', err);
index 5621e90..8a317b4 100644 (file)
@@ -43,13 +43,15 @@ User.prototype.queueStatusUpdate = function(status, evt) {
 
 
 function findAndUpdate(obj, condition) {
+  // console.log(obj);
+  // console.log('userupdate', condition);
+  // console.log('status', obj.status);
   return UserModel
     .update(obj, {
       where: condition,
-      individualHooks: true,
-      raw: true
+      individualHooks: true
     })
-    .then(function() {
+    .then(function(member) {
       console.log('[user] status update');
     })
     .catch(function(err) {
index 2d26641..b6dfaf7 100644 (file)
@@ -1,7 +1,3 @@
-'use strict';
-
-const emitter = require('cluster-emitter');
-
 var VoiceContext = require('../../models').VoiceContext;
 var VoiceExtension = require('../../models').VoiceExtension;
 var fs = require('fs');
@@ -10,30 +6,28 @@ var path = require('path');
 var config = require('../../config/environment');
 
 function Context(ami) {
-
-  emitter.on('VoiceContext.beforeUpdate', function(doc, options) {
-    if (doc.changed('name')) {
+  VoiceContext.beforeUpdate(function(updatedContext) {
+    if (updatedContext.changed('name')) {
       throw new Error("You can't modify a context name");
     }
-    if (doc.defaultEntry) {
+    if (updatedContext.defaultEntry) {
       throw new Error("You can't modify a default context");
     }
   });
 
-  emitter.on('VoiceContext.beforeDelete', function(doc, options) {
-    if (doc.defaultEntry) {
+  VoiceContext.beforeDelete(function(context) {
+    if (context.defaultEntry) {
       throw new Error("You can't delete a default context");
     }
   });
-
-  emitter.on('VoiceContext.afterCreate', function(doc, options) {
+  VoiceContext.afterCreate(function(doc) {
     rewriteContexts(doc, ami, false);
     createHangup(doc);
-  });
+  })
 
-  emitter.on('VoiceContext.afterDelete', function(doc, options) {
+  VoiceContext.afterDelete(function(doc) {
     rewriteContexts(doc, ami, true);
-  });
+  })
 }
 
 function rewriteContexts(doc, ami, deleteContext) {
@@ -94,10 +88,8 @@ function createHangup(doc) {
   }];
 
   return VoiceExtension
-    .bulkCreate(data, {
-      raw: true
-    })
-    .then(function() {
+    .bulkCreate(data)
+    .then(function(res) {
       console.log('hangup extension created');
     })
     .catch(function(err) {
index dadde96..bf45b45 100644 (file)
@@ -2,14 +2,14 @@
 
 var _ = require('lodash');
 var moment = require('moment');
-var emitter = require('cluster-emitter');
 
 var Automation = require('../../models').Automation;
 var ChatRoom = require('../../models').ChatRoom;
+var automationTimeout;
 var activeChatAutomations = {};
 
 function executeAutomation(id) {
-  console.log('[Automation] Executing Chat', id);
+  console.log('Executing Chat Automation ', id);
   var _chatAutomation;
   return Automation
     .scope('all')
@@ -52,9 +52,7 @@ function executeAutomation(id) {
       });
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Chat exec');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Chat Automation exec error', err);
     });
 }
 
@@ -67,9 +65,7 @@ function setStatus(ticketId, newStatus) {
       }
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Mail setStatus');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Automatic chat status error', err);
     });
 }
 
@@ -121,7 +117,7 @@ function getCondition(condition) {
 }
 
 function createInterval(chatAutomation) {
-  console.log('[Automation] Mail', chatAutomation.id, 'set with timeout', chatAutomation.timeout * 60 * 1000);
+  console.log('Chat Automation ', chatAutomation.id, ' set with timeout ', chatAutomation.timeout * 60 * 1000);
   activeChatAutomations['interval' + chatAutomation.id] = setInterval(function() {
     executeAutomation(chatAutomation.id);
   }, chatAutomation.timeout * 60 * 1000);
@@ -129,39 +125,31 @@ function createInterval(chatAutomation) {
 
 module.exports = function() {
 
-  console.log('[Automation] Chat service started');
-
-  emitter.on('Automation.afterCreate', function(doc, options) {
-    if (doc.channel === 'chat') {
-      console.log('[Automation] Chat', doc.id, 'created, the status is', doc.status);
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterCreate(function(doc, options) {
+    console.log('Chat Automation ', doc.id, ' created, the status is ', doc.status);
+    if (doc.status && doc.channel === 'chat') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterUpdate', function(doc, options) {
-    if (doc.channel === 'chat') {
-      console.log('[Automation] Chat', doc.id, 'updated, the status is', doc.status);
-      if (activeChatAutomations['interval' + doc.id]) {
-        console.log('[Automation] Chat unset ', doc.id);
-        clearInterval(activeChatAutomations['interval' + doc.id]);
-        delete activeChatAutomations['interval' + doc.id];
-      }
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterUpdate(function(doc, options) {
+    console.log('Chat Automation ', doc.id, ' updated, the status is ', doc.status);
+    if (activeChatAutomations['interval' + doc.id]) {
+      console.log('Chat automation unset ', doc.id);
+      clearInterval(activeChatAutomations['interval' + doc.id]);
+      delete activeChatAutomations['interval' + doc.id];
+    }
+    if (doc.status && doc.channel === 'chat') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterDelete', function(doc, options) {
-    if (doc.channel === 'chat') {
-      console.log('[Automation] Chat', doc.id, ' deleted');
-      if (activeChatAutomations['interval' + doc.id]) {
-        console.log('[Automation] Chat unset ', doc.id);
-        clearInterval(activeChatAutomations['interval' + doc.id]);
-        delete activeChatAutomations['interval' + doc.id];
-      }
+  Automation.afterDelete(function(doc, options) {
+    console.log('Chat Automation ', doc.id, ' deleted');
+    if (activeChatAutomations['interval' + doc.id]) {
+      console.log('Chat automation unset ', doc.id);
+      clearInterval(activeChatAutomations['interval' + doc.id]);
+      delete activeChatAutomations['interval' + doc.id];
     }
   });
 
@@ -176,16 +164,11 @@ module.exports = function() {
     })
     .then(function(chatAutomations) {
 
-      console.log('[Automation] Chat are', chatAutomations.length);
-
       chatAutomations.forEach(function(chatAutomation) {
         createInterval(chatAutomation);
       });
-
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Chat init');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Chat Automation init error', err);
     });
 };
index 6606ffa..e7f0b74 100644 (file)
@@ -1,15 +1,18 @@
 'use strict';
 
 var _ = require('lodash');
+var config = require('../environment');
 var moment = require('moment');
-var emitter = require('cluster-emitter');
+// var stringifyObject = require('stringify-object');
 
+var sequelize = require('../../models').sequelize;
 var Automation = require('../../models').Automation;
 var FaxRoom = require('../../models').FaxRoom;
+var automationTimeout;
 var activeFaxAutomations = {};
 
 function executeAutomation(id) {
-  console.log('[Automation] Executing Fax', id);
+  console.log('Executing Mail Automation ', id);
   var _faxAutomation;
   return Automation
     .scope('all')
@@ -53,9 +56,7 @@ function executeAutomation(id) {
       });
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Fax exec');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Fax Automation exec error', err);
     });
 }
 
@@ -68,9 +69,7 @@ function setStatus(ticketId, newStatus) {
       }
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Fax setStatus');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Automatic mail status error', err);
     });
 }
 
@@ -122,7 +121,7 @@ function getCondition(condition) {
 }
 
 function createInterval(faxAutomation) {
-  console.log('[Automation] Mail', faxAutomation.id, 'set with timeout', faxAutomation.timeout * 60 * 1000);
+  console.log('Fax Automation ', faxAutomation.id, ' set with timeout ', faxAutomation.timeout * 60 * 1000);
   activeFaxAutomations['interval' + faxAutomation.id] = setInterval(function() {
     executeAutomation(faxAutomation.id);
   }, faxAutomation.timeout * 60 * 1000);
@@ -130,39 +129,31 @@ function createInterval(faxAutomation) {
 
 module.exports = function() {
 
-  console.log('[Automation] Fax service started');
-
-  emitter.on('Automation.afterCreate', function(doc, options) {
-    if (doc.channel === 'fax') {
-      console.log('[Automation] Fax', doc.id, 'created, the status is', doc.status);
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterCreate(function(doc, options) {
+    console.log('Fax Automation ', doc.id, ' created, the status is ', doc.status);
+    if (doc.status && doc.channel === 'fax') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterUpdate', function(doc, options) {
-    if (doc.channel === 'fax') {
-      console.log('[Automation] Fax', doc.id, 'updated, the status is', doc.status);
-      if (activeFaxAutomations['interval' + doc.id]) {
-        console.log('[Automation] Fax unset ', doc.id);
-        clearInterval(activeFaxAutomations['interval' + doc.id]);
-        delete activeFaxAutomations['interval' + doc.id];
-      }
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterUpdate(function(doc, options) {
+    console.log('Fax Automation ', doc.id, ' updated, the status is ', doc.status);
+    if (activeFaxAutomations['interval' + doc.id]) {
+      console.log('Fax automation unset ', doc.id);
+      clearInterval(activeFaxAutomations['interval' + doc.id]);
+      delete activeFaxAutomations['interval' + doc.id];
+    }
+    if (doc.status && doc.channel === 'fax') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterDelete', function(doc, options) {
-    if (doc.channel === 'fax') {
-      console.log('[Automation] Fax', doc.id, ' deleted');
-      if (activeFaxAutomations['interval' + doc.id]) {
-        console.log('[Automation] Fax unset ', doc.id);
-        clearInterval(activeFaxAutomations['interval' + doc.id]);
-        delete activeFaxAutomations['interval' + doc.id];
-      }
+  Automation.afterDelete(function(doc, options) {
+    console.log('Fax Automation ', doc.id, ' deleted');
+    if (activeFaxAutomations['interval' + doc.id]) {
+      console.log('Fax automation unset ', doc.id);
+      clearInterval(activeFaxAutomations['interval' + doc.id]);
+      delete activeFaxAutomations['interval' + doc.id];
     }
   });
 
@@ -177,16 +168,11 @@ module.exports = function() {
     })
     .then(function(faxAutomations) {
 
-      console.log('[Automation] Fax are', faxAutomations.length);
-
       faxAutomations.forEach(function(faxAutomation) {
         createInterval(faxAutomation);
       });
-
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Mail init');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Fax Automation init error', err);
     });
 };
index cd4d174..14f8d17 100644 (file)
@@ -1,15 +1,17 @@
 'use strict';
 
 var _ = require('lodash');
+var config = require('../environment');
 var moment = require('moment');
-var emitter = require('cluster-emitter');
+// var stringifyObject = require('stringify-object');
 
+var sequelize = require('../../models').sequelize;
 var Automation = require('../../models').Automation;
 var MailRoom = require('../../models').MailRoom;
 var activeMailAutomations = {};
 
 function executeAutomation(id) {
-  console.log('[Automation] Executing Mail', id);
+  console.log('Executing Mail Automation ', id);
   var _mailAutomation;
   return Automation
     .scope('all')
@@ -53,9 +55,7 @@ function executeAutomation(id) {
       });
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Mail exec');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Mail Automation exec error', err);
     });
 }
 
@@ -68,9 +68,7 @@ function setStatus(ticketId, newStatus) {
       }
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Mail setStatus');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Automatic mail status error', err);
     });
 }
 
@@ -122,7 +120,7 @@ function getCondition(condition) {
 }
 
 function createInterval(mailAutomation) {
-  console.log('[Automation] Mail', mailAutomation.id, 'set with timeout', mailAutomation.timeout * 60 * 1000);
+  console.log('Mail Automation ', mailAutomation.id, ' set with timeout ', mailAutomation.timeout * 60 * 1000);
   activeMailAutomations['interval' + mailAutomation.id] = setInterval(function() {
     executeAutomation(mailAutomation.id);
   }, mailAutomation.timeout * 60 * 1000);
@@ -130,39 +128,31 @@ function createInterval(mailAutomation) {
 
 module.exports = function() {
 
-  console.log('[Automation] Mail service started');
-
-  emitter.on('Automation.afterCreate', function(doc, options) {
-    if (doc.channel === 'mail') {
-      console.log('[Automation] Mail', doc.id, 'created, the status is', doc.status);
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterCreate(function(doc, options) {
+    console.log('Mail Automation ', doc.id, ' created, the status is ', doc.status);
+    if (doc.status && doc.channel === 'mail') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterUpdate', function(doc, options) {
-    if (doc.channel === 'mail') {
-      console.log('[Automation] Mail', doc.id, 'updated, the status is', doc.status);
-      if (activeMailAutomations['interval' + doc.id]) {
-        console.log('[Automation] Mail unset ', doc.id);
-        clearInterval(activeMailAutomations['interval' + doc.id]);
-        delete activeMailAutomations['interval' + doc.id];
-      }
-      if (doc.status) {
-        createInterval(doc);
-      }
+  Automation.afterUpdate(function(doc, options) {
+    console.log('Mail Automation ', doc.id, ' updated, the status is ', doc.status);
+    if (activeMailAutomations['interval' + doc.id]) {
+      console.log('Mail automation unset ', doc.id);
+      clearInterval(activeMailAutomations['interval' + doc.id]);
+      delete activeMailAutomations['interval' + doc.id];
+    }
+    if (doc.status && doc.channel === 'mail') {
+      createInterval(doc);
     }
   });
 
-  emitter.on('Automation.afterDelete', function(doc, options) {
-    if (doc.channel === 'mail') {
-      console.log('[Automation] Mail', doc.id, ' deleted');
-      if (activeMailAutomations['interval' + doc.id]) {
-        console.log('[Automation] Mail unset ', doc.id);
-        clearInterval(activeMailAutomations['interval' + doc.id]);
-        delete activeMailAutomations['interval' + doc.id];
-      }
+  Automation.afterDelete(function(doc, options) {
+    console.log('Mail Automation ', doc.id, ' deleted');
+    if (activeMailAutomations['interval' + doc.id]) {
+      console.log('Mail automation unset ', doc.id);
+      clearInterval(activeMailAutomations['interval' + doc.id]);
+      delete activeMailAutomations['interval' + doc.id];
     }
   });
 
@@ -177,16 +167,11 @@ module.exports = function() {
     })
     .then(function(mailAutomations) {
 
-      console.log('[Automation] Mail are', mailAutomations.length);
-
       mailAutomations.forEach(function(mailAutomation) {
         createInterval(mailAutomation);
       });
-
     })
     .catch(function(err) {
-      console.error('[Automation] Error in Mail init');
-      console.error('[Automation] Message:', err.message);
-      console.error('[Automation] Stack:', err.stack);
+      console.log('Mail Automation init error', err);
     });
 };
index 53afae5..93bfa0d 100644 (file)
@@ -1,13 +1,20 @@
 'use strict';
 
 var util = require('util');
+var path = require('path');
 
 var _ = require('lodash');
 var Promise = require('bluebird');
 var ImapListener = require("mail-listener2");
 var writeFile = Promise.promisify(require("fs").writeFile);
 
+var config = require('../environment');
+
 var Server = require('../../models').MailServerIn;
+var Room = require('../../models').MailRoom;
+var Message = require('../../models').MailMessage;
+var Account = require('../../models').MailAccount;
+var Attachment = require('../../models').MailAttachment;
 
 var imap;
 var timeout;
@@ -17,7 +24,7 @@ process
     console.log(util.format('IMAP SERVER %s EXITED WITH CODE %s, PROCESS ID: %s ', process.argv[3], code, process.pid));
   })
   .on('error', function(err) {
-    console.error('test', err);
+    console.error(err);
   });
 
 console.log(util.format('IMAP SERVER %s STARTING, PROCESS ID: %s ', process.argv[3], process.pid));
index 94ddc6f..053702c 100644 (file)
@@ -3,26 +3,25 @@
 const _ = require('lodash');
 const util = require('util');
 const path = require('path');
-const Promise = require('bluebird');
-const moment = require('moment');
-const emitter = require('cluster-emitter');
 const cp = require('child_process');
-
 const ms = require('../../models').MailServerIn;
 const msg = require('../../models').MailMessage;
 const Room = require('../../models').MailRoom;
+const Status = require('../../models').MailRoomStatus;
 const Message = require('../../models').MailMessage;
 const Account = require('../../models').MailAccount;
 const Contact = require('../../models').Contact;
 const Company = require('../../models').Company;
 const Attachment = require('../../models').MailAttachment;
 const ReportMail = require('../../models').ReportMail;
-
-const open = Promise.promisify(require('fs').open);
-const close = Promise.promisify(require('fs').close);
-const write = Promise.promisify(require('fs').write);
+const ReportMailRoom = require('../../models').ReportMailRoom;
+const ReportMailSession = require('../../models').ReportMailSession;
+const Promise = require('bluebird');
+const moment = require('moment');
+const open = Promise.promisify(require("fs").open);
+const close = Promise.promisify(require("fs").close);
+const write = Promise.promisify(require("fs").write);
 const config = require('../environment');
-
 var mailaccounts;
 var Scheduler = require('../routing/scheduler');
 var Util = require('../util');
@@ -446,13 +445,14 @@ function fork(id, username) {
 }
 
 function execRequest(doc, method, url) {
-  return Util
-    .sendRequest(doc, method, url)
+  Util.sendRequest(doc, method, url)
     .then(function(res) {
       console.log('request successeful!');
+
     })
     .catch(function(err) {
       console.log('request failed!');
+
     })
 }
 
@@ -490,17 +490,16 @@ function webhook(doc, account, hook) {
 }
 
 function synch(mailaccounts) {
-  emitter.on('MailAccount.afterDestroy', function(doc, options) {
+  Account.afterDestroy(function(doc) {
     _.remove(mailaccounts, {
       id: doc.id
     });
   });
-
-  emitter.on('MailAccount.afterCreate', function(doc, options) {
+  Account.afterCreate(function(doc) {
+    console.log('Mail account: ' + doc.name + ' Create');
     mailaccounts.push(doc);
   });
-
-  emitter.on('MailAccount.afterUpdate', function(doc, options) {
+  Account.afterUpdate(function(doc) {
     var oldItem = _.find(mailaccounts, {
       id: doc.id
     });
@@ -524,14 +523,12 @@ module.exports = function() {
       }
     }
   });
-
   Account
     .findAll()
     .then(function(accounts) {
       mailaccounts = accounts;
       synch(mailaccounts);
-
-      emitter.on('ReportMail.afterUpdate', function(doc, options) {
+      ReportMail.afterUpdate(function(doc) {
         var account = _.find(mailaccounts, {
           id: parseInt(doc.accountid)
         });
@@ -542,25 +539,23 @@ module.exports = function() {
           webhook(doc, account, 'reject');
         }
       });
-
-      emitter.on('MailRoom.afterUpdate', function(doc, options) {
+      Room.afterUpdate(function(doc) {
         var account = _.find(mailaccounts, {
           id: doc.MailAccountId
         });
         if (account && doc.changed('status') && doc.status === 'CLOSED') {
           webhook(doc, account, 'close');
         }
-      });
+      })
     })
     .catch(function(err) {
       console.error(err);
     });
-
-  emitter.on('MailServerIn.afterCreate', function(server, options) {
+  ms.afterCreate(function(server) {
     childs[server.id] = fork(server.id, server.username);
   });
 
-  emitter.on('MailServerIn.afterUpdate', function(server, options) {
+  ms.afterUpdate(function(server) {
     if (childs[server.id]) {
       if (server.changed('state') || server.changed('source')) {
         console.log(util.format('IMAP SERVER %s UPDATED, PROCESS ID: %s ', server.id, childs[server.id].pid));
@@ -584,7 +579,7 @@ module.exports = function() {
     }
   });
 
-  emitter.on('MailServerIn.afterDestroy', function(server, options) {
+  ms.afterDestroy(function(server) {
     if (childs[server.id]) {
       console.log(util.format('IMAP SERVER %s DESTROYED, PROCESS ID: %s ', server.id, childs[server.id].pid));
 
@@ -593,11 +588,9 @@ module.exports = function() {
     }
   });
 
-  ms
-    .findAll()
+  ms.findAll()
     .then(function(servers) {
       servers.forEach(function(server) {
-        console.log('server', server.id);
         childs[server.id] = fork(server.id, server.username);
       });
     })
index f9d13b0..429d7a2 100644 (file)
@@ -3,7 +3,6 @@ var MailServerOut = require('../../models').MailServerOut;
 var CronJobManager = require('cron-job-manager');
 var _ = require('lodash');
 var Reports = require('./reports');
-var emitter = require('cluster-emitter');
 
 
 function deleteSchedule(data, manager) {
@@ -90,16 +89,15 @@ function executeSchedule(scheduleId, reports) {
 }
 
 function synchSchedules(manager, reports) {
-  emitter.on('Schedule.afterCreate', function(doc) {
+  Schedule.afterCreate(function(doc, options) {
     if (doc.active) {
-      createJob(doc, manager, reports);
+      createJob(doc.dataValues, manager, reports);
     }
   });
-  emitter.on('Schedule.afterUpdate', function(doc) {
-    updateSchedule(doc, manager, reports);
+  Schedule.afterUpdate(function(doc, options) {
+    updateSchedule(doc.dataValues, manager, reports);
   });
-  emitter.on('Schedule.afterDestroy', function(doc) {
-    deleteSchedule(doc, manager);
+  Schedule.afterDestroy(function(doc) {
+    deleteSchedule(doc.dataValues, manager);
   });
-  Schedule.afterCreate(function(doc, options) {});
 }
index c4f7cd6..e46d29d 100644 (file)
@@ -41,7 +41,7 @@ function onDisconnect(socket) {
   }
 }
 
-function onConnect(socket) {
+function onConnect(socket, dashboardProcess) {
 
   console.info('[%s] SOCKET CONNECTED', socket.handshake.address);
 
@@ -256,7 +256,7 @@ function onConnect(socket) {
   });
 }
 
-module.exports = function(socketio) {
+module.exports = function(socketio, dashboardProcess) {
   // socket.io (v1.x.x) is powered by debug.
   // In order to see all the debug output, set DEBUG (in server/config/local.env.js) to including the desired scope.
   //
@@ -280,6 +280,6 @@ module.exports = function(socketio) {
     });
 
     // Call onConnect.
-    onConnect(socket);
+    onConnect(socket, dashboardProcess);
   });
 };
index 0bc37a8..d46a052 100644 (file)
@@ -1,31 +1,30 @@
 'use strict';
 
-const User = require('../../models').User;
-const ChanSpyModel = require('../../models').ChanSpy;
-const VoiceExtension = require('../../models').VoiceExtension;
-
-const util = require('util');
-const Promise = require('bluebird');
-const emitter = require('cluster-emitter');
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
+var config = require('../../config/environment');
+var ChanSpyModel = require('../../models').ChanSpy;
+var User = require('../../models').User;
+var VoiceExtension = require('../../models').VoiceExtension;
+var sequelize = require('../../models').sequelize;
+var Promise = require('bluebird');
 
 function ChanSpy() {
-
-  emitter.on('ChanSpy.afterCreate', function(doc, options) {
+  ChanSpyModel.afterCreate(function(doc, options) {
     return Promise
       .all([])
       .then(createSpyExtensions(doc, options));
-  });
-
-  emitter.on('ChanSpy.afterUpdate', function(doc, options) {
+  })
+  ChanSpyModel.afterUpdate(function(doc, options) {
     return Promise
       .all([])
       .then(deleteSpyExtensions(doc, options))
       .then(createSpyExtensions(doc, options));
-  });
-
-  emitter.on('ChanSpy.afterDestroy', function(doc, options) {
+  })
+  ChanSpyModel.afterDelete(function(doc, options) {
     return deleteSpyExtensions(doc, options);
-  });
+  })
 }
 
 function deleteSpyExtensions(doc, options) {
@@ -34,7 +33,6 @@ function deleteSpyExtensions(doc, options) {
       where: {
         ChanSpyId: doc.id
       },
-      raw: true,
       transaction: options.transaction
     });
 }
index 241c1d9..69714fe 100644 (file)
@@ -1,16 +1,15 @@
 'use strict';
 
-const _ = require('lodash');
-const moment = require('moment');
-const emitter = require('cluster-emitter');
+var _ = require('lodash');
+var moment = require('moment');
 
-const ChatRoomModel = require('../../models').ChatRoom;
-const ChatVisitorModel = require('../../models').ChatVisitor;
-const ReportChatSessionModel = require('../../models').ReportChatSession;
-const ReportChatRoomModel = require('../../models').ReportChatRoom;
+var ChatRoomModel = require('../../models').ChatRoom;
+var ChatVisitorModel = require('../../models').ChatVisitor;
+var ReportChatSessionModel = require('../../models').ReportChatSession;
+var ReportChatRoomModel = require('../../models').ReportChatRoom;
 
 function ChatRoom() {
-  emitter.on('ChatRoom.afterUpdate', function(doc, options) {
+  ChatRoomModel.afterUpdate(function(doc) {
     if (doc.changed('status') && doc.status === 'CLOSED') {
       if (doc.ChatVisitorId) {
         return ChatVisitorModel
@@ -98,7 +97,8 @@ function ChatRoom() {
           });
       }
     }
-  });
+
+  })
 }
 
 module.exports = ChatRoom;
index f89478b..223b7bf 100644 (file)
@@ -1,7 +1,7 @@
 'use strict';
 
-const emitter = require('cluster-emitter');
-
+var _ = require('lodash');
+var util = require('util');
 var IntervalModel = require('../../models').Interval;
 var VoiceExtension = require('../../models').VoiceExtension;
 var veUtil = require('../../utils/voice_extension');
@@ -10,21 +10,21 @@ var Applications = veUtil.Applications;
 
 function Interval() {
   console.log('Interval Initialization..');
+  IntervalModel.afterUpdate(function(interval) {
+    updatevoiceExtension(interval);
+  })
 
-  emitter.on('MailRoom.afterUpdate', function(doc, options) {
-    updatevoiceExtension(doc);
-  });
-
-  emitter.on('MailRoom.beforeDestroy', function(doc, options) {
-    if (doc.IntervalId !== null) {
-      updatevoiceExtension(doc);
+  IntervalModel.beforeDestroy(function(interval) {
+    if (interval.IntervalId !== null) {
+      updatevoiceExtension(interval);
     }
-  });
-  emitter.on('MailRoom.afterCreate', function(doc, options) {
-    if (doc.IntervalId !== null) {
-      updatevoiceExtension(doc);
+  })
+
+  IntervalModel.afterCreate(function(interval) {
+    if (interval.IntervalId !== null) {
+      updatevoiceExtension(interval);
     }
-  });
+  })
 }
 
 function updatevoiceExtension(interval) {
@@ -70,4 +70,5 @@ function updatevoiceExtension(interval) {
     });
 }
 
+
 module.exports = Interval;
index 3ec9f00..e2da0c5 100644 (file)
@@ -2,12 +2,11 @@
 
 const _ = require('lodash');
 const moment = require('moment');
-const emitter = require('cluster-emitter');
 
 const Account = require('../../models').MailAccount;
 
 function MailAccount() {
-  emitter.on('MailAccount.afterCreate', function(doc, options) {
+  Account.afterCreate(function(doc, opt) {
     if (doc.service) {
       return Account
         .update({
@@ -17,13 +16,12 @@ function MailAccount() {
             id: {
               $ne: doc.id
             }
-          },
-          raw: true
+          }
         });
     }
   });
 
-  emitter.on('MailAccount.afterUpdate', function(doc, options) {
+  Account.afterUpdate(function(doc, opt) {
     if (doc.changed('service') && doc.service) {
       return Account
         .update({
@@ -33,8 +31,7 @@ function MailAccount() {
             id: {
               $ne: doc.id
             }
-          },
-          raw: true
+          }
         });
     }
   });
index 29a1520..697cbbb 100644 (file)
@@ -2,32 +2,31 @@
 
 const _ = require('lodash');
 const moment = require('moment');
-const emitter = require('cluster-emitter');
 
 const Room = require('../../models').MailRoom;
 const Status = require('../../models').MailRoomStatus;
 
 function MailRoom() {
-  emitter.on('MailRoom.afterCreate', function(doc, options) {
+  Room.afterCreate(function(doc, opt) {
     return Status
       .create({
         status: doc.status,
-        data1: options.user ? options.user.name : null,
-        data2: options.user ? options.user.fullname : null,
+        data1: opt.user ? opt.user.name : null,
+        data2: opt.user ? opt.user.fullname : null,
         MailRoomId: doc.id,
-        UserId: options.user ? options.user.id : null
+        UserId: opt.user ? opt.user.id : null
       });
   });
 
-  emitter.on('Room.afterUpdate', function(doc, options) {
+  Room.afterUpdate(function(doc, opt) {
     if (doc.changed('status') || doc.changed('openReason')) {
       return Status
         .create({
           status: doc.status,
-          data1: options.user ? options.user.name : null,
-          data2: options.user ? options.user.fullname : null,
+          data1: opt.user ? opt.user.name : null,
+          data2: opt.user ? opt.user.fullname : null,
           MailRoomId: doc.id,
-          UserId: options.user ? options.user.id : null
+          UserId: opt.user ? opt.user.id : null
         });
     }
   });
diff --git a/server/config/tools/queueParameters.js b/server/config/tools/queueParameters.js
new file mode 100644 (file)
index 0000000..81ea345
--- /dev/null
@@ -0,0 +1,384 @@
+/**
+ * Broadcast updates to client when the model changes
+ */
+
+'use strict';
+
+var sequelize = require('../../models').sequelize;
+var models = require('../../models');
+var Util = require('../../config/util');
+var Promise = require('bluebird');
+var _ = require('lodash');
+var util = require('util');
+
+exports.register = function(socket) {
+  // Inbound Events
+  models.ReportQueue.afterCreate(function(doc) {
+    onWaiting(socket, doc);
+  });
+  models.ReportQueue.afterUpdate(function(doc) {
+    if (doc.changed('queuecallerleaveAt')) {
+      onWaiting(socket, doc);
+      onActive(socket, doc);
+    }
+  });
+  models.ReportQueue.afterUpdate(function(doc) {
+    if (doc.changed('queuecallerabandon') || doc.changed('queuecallercomplete')) {
+      onAbandon(socket, doc);
+      onComplete(socket, doc);
+      onActive(socket, doc);
+      onAvgAnswerTime(socket, doc);
+      onAvgTalkTime(socket, doc);
+      onTotalOffered(socket, doc);
+      onUnmanaged(socket, doc);
+    }
+  });
+}
+
+function getQueues(id, role) {
+  return function() {
+    switch (role) {
+      case 'user':
+        return models.User
+          .findById(id, {
+            attributes: ['id']
+          })
+          .then(Util.getVoiceQueuesIdByUser());
+      default:
+        return models.VoiceQueue
+          .findAll()
+          .then(function(queues) {
+            return {
+              rows: queues
+            };
+          });
+    }
+  }
+}
+
+function onWaiting(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        return models
+          .ReportQueue
+          .findAll({
+            where: {
+              queuecallerleaveAt: null,
+              queue: _.find(userQueues.rows, {
+                name: doc.queue
+              }) ? doc.queue : []
+            },
+            group: 'queue',
+            attributes: [
+              ['queue', 'name'],
+              [sequelize.fn('COUNT', sequelize.col('id')), 'waiting']
+            ]
+          });
+      }
+      return null;
+    })
+    .then(function(waiting) {
+      if (waiting) {
+        var _parameters;
+        if (waiting.length) {
+          _parameters = waiting[0].dataValues;
+        } else {
+          _parameters = {
+            name: doc.queue,
+            waiting: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('WAITING ERROR', err);
+    });
+}
+
+function onActive(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        return models
+          .ReportQueue
+          .findAll({
+            where: {
+              queuecallerexit: false,
+              queuecallerabandon: false,
+              queuecallercomplete: false,
+              queuecallerleaveAt: {
+                $ne: null
+              },
+              queue: _.find(userQueues.rows, {
+                name: doc.queue
+              }) ? doc.queue : []
+            },
+            group: 'queue',
+            attributes: [
+              ['queue', 'name'],
+              [sequelize.fn('COUNT', sequelize.col('id')), 'active']
+            ]
+          });
+      }
+      return null;
+    })
+    .then(function(active) {
+      if (active) {
+        var _parameters;
+        if (active.length) {
+          _parameters = active[0].dataValues;
+        } else {
+          _parameters = {
+            name: doc.queue,
+            active: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('ACTIVE ERROR', err);
+    });
+}
+
+function onAbandon(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        return models
+          .ReportQueue
+          .findAll({
+            where: {
+              queuecallerabandon: true,
+              queue: _.find(userQueues.rows, {
+                name: doc.queue
+              }) ? doc.queue : []
+            },
+            group: 'queue',
+            attributes: [
+              ['queue', 'name'],
+              [sequelize.fn('COUNT', sequelize.col('id')), 'abandoned']
+            ]
+          });
+      }
+      return null;
+    })
+    .then(function(abandoned) {
+      if (abandoned) {
+        var _parameters;
+        if (abandoned.length) {
+          _parameters = abandoned[0].dataValues;
+        } else {
+          _parameters = {
+            name: doc.queue,
+            abandoned: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('ABANDONED ERROR', err);
+    });
+}
+
+function onComplete(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        return models
+          .ReportQueue
+          .findAll({
+            where: {
+              queuecallercomplete: true,
+              queue: _.find(userQueues.rows, {
+                name: doc.queue
+              }) ? doc.queue : []
+            },
+            group: 'queue',
+            attributes: [
+              ['queue', 'name'],
+              [sequelize.fn('COUNT', sequelize.col('id')), 'answered']
+            ]
+          });
+      }
+      return null;
+    })
+    .then(function(answered) {
+      if (answered) {
+        var _parameters;
+        if (answered.length) {
+          _parameters = answered[0].dataValues;
+        } else {
+          _parameters = {
+            name: doc.queue,
+            answered: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('ANSWERED ERROR', err);
+    });
+}
+
+function onAvgAnswerTime(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        var queue = _.find(userQueues.rows, {
+          name: doc.queue
+        }) ? doc.queue : '';
+        var query = util.format('SELECT queue AS \'name\',SEC_TO_TIME(ROUND(AVG(holdtime), 0)) as holdtime FROM report_agent WHERE agentcomplete = 1 AND queue =\'%s\' GROUP BY queue', queue);
+        return sequelize
+          .query(query, {
+            type: sequelize.QueryTypes.SELECT
+          });
+      }
+      return null;
+    })
+    .then(function(holdtime) {
+      if (holdtime) {
+        var _parameters;
+        if (holdtime.length) {
+          _parameters = holdtime[0];
+        } else {
+          _parameters = {
+            name: doc.queue,
+            holdtime: '00:00:00'
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('HOLDTIME ERROR', err);
+    });
+}
+
+function onAvgTalkTime(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        var queue = _.find(userQueues.rows, {
+          name: doc.queue
+        }) ? doc.queue : '';
+        return sequelize
+          .query(util.format('SELECT queue AS \'name\',SEC_TO_TIME(ROUND(AVG(talktime), 0)) as talktime FROM report_agent WHERE agentcomplete = 1 AND queue =\'%s\' GROUP BY queue', queue), {
+            type: sequelize.QueryTypes.SELECT
+          });
+      }
+      return null;
+    })
+    .then(function(talktime) {
+      if (talktime) {
+        var _parameters;
+        if (talktime.length) {
+          _parameters = talktime[0];
+        } else {
+          _parameters = {
+            name: doc.queue,
+            talktime: '00:00:00'
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('TALKTIME ERROR', err);
+    });
+}
+
+
+function onTotalOffered(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        var queue = _.find(userQueues.rows, {
+          name: doc.queue
+        }) ? doc.queue : '';
+        return sequelize
+          .query(util.format('SELECT queue AS \'name\',COUNT(distinct uniqueid) as totalcalls FROM report_queue WHERE queue =\'%s\' GROUP BY queue', queue), {
+            type: sequelize.QueryTypes.SELECT
+          });
+      }
+      return null;
+    })
+    .then(function(totalcalls) {
+      if (totalcalls) {
+        var _parameters;
+        if (totalcalls.length) {
+          _parameters = totalcalls[0];
+        } else {
+          _parameters = {
+            name: doc.queue,
+            totalcalls: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('TOTALCALLS ERROR', err);
+    });
+}
+
+function onUnmanaged(socket, doc) {
+  return Promise
+    .all([])
+    .then(getQueues(socket.userId, socket.role))
+    .then(function(userQueues) {
+      if (userQueues.rows.length) {
+        return models
+          .ReportQueue
+          .findAll({
+            where: {
+              queuecallerexit: true,
+              queue: _.find(userQueues.rows, {
+                name: doc.queue
+              }) ? doc.queue : []
+            },
+            group: 'queue',
+            attributes: [
+              ['queue', 'name'],
+              [sequelize.fn('COUNT', sequelize.col('id')), 'unmanaged']
+            ]
+          });
+      }
+      return null;
+    })
+    .then(function(unmanaged) {
+      if (unmanaged) {
+        var _parameters;
+        if (unmanaged.length) {
+          _parameters = unmanaged[0].dataValues;
+        } else {
+          _parameters = {
+            name: doc.queue,
+            _parameters: 0
+          };
+        }
+        socket.emit('report_queue:parameters', _parameters);
+      }
+    })
+    .catch(function(err) {
+      console.error('UNMANAGED ERROR', err);
+    });
+}
index 3ac3cce..50b0908 100644 (file)
@@ -1,16 +1,18 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
+var fs = require('fs');
 var util = require('util');
+var path = require('path');
+var config = require('../../config/environment');
 var UserModel = require('../../models').User;
 var VoiceExtension = require('../../models').VoiceExtension;
 var ChanSpy = require('../../models').ChanSpy;
+var sequelize = require('../../models').sequelize;
 var Promise = require('bluebird');
 
 function User() {
-  emitter.on('User.afterCreate', function(doc, options) {
+  UserModel.afterCreate(function(doc, options) {
     delete doc._changed.internal;
-
     return Promise
       .all([])
       .then(createCallerID(doc, options))
@@ -20,45 +22,43 @@ function User() {
           createChanspy(doc, options);
         }
       })
-  });
+  })
 
-  emitter.on('User.beforeUpdate', function(doc, options) {
-    if (options.changed.internal) {
-      throw new Error('You can\'t modify the internal of a User/Agent/Telephone');
+  UserModel.beforeUpdate(function(doc, options) {
+    if (doc.changed('internal')) {
+      throw new sequelize.Error("You can't modify the internal of a User/Agent/Telephone");
     }
-  });
+  })
 
-  emitter.on('User.afterUpdate', function(doc, options) {
-    if (!options.changed.status &&
-      !options.changed.queueStatus &&
-      !options.changed.callerid &&
-      !options.changed.lastLoginAt &&
-      !options.changed.online) {
+  UserModel.afterUpdate(function(doc, options) {
+    // console.log('Users updated', doc._changed);
+    // console.log(doc._changed, doc.name, doc.status);
+    if (!doc.changed('status') && !doc.changed('queueStatus') && !doc.changed('callerid') && !doc.changed('lastLoginAt') && !doc.changed('online')) {
       return Promise
         .all([])
         .then(createCallerID(doc, options))
         .then(function() {
-          if (doc.chanspy && options.changed.chanspy) {
+          if ((doc.chanspy && doc.changed('chanspy'))) {
             return createChanspy(doc, options);
           }
         })
         .then(function() {
-          if (doc.chanspy && !options.changed.chanspy && options.changed.name) {
+          if (doc.chanspy && !doc.changed('chanspy') && doc.changed('name')) {
             return deleteChanSpy(doc, options);
           }
         })
         .then(function() {
-          if (doc.chanspy && !options.changed.chanspy && options.changed.name) {
+          if (doc.chanspy && !doc.changed('chanspy') && doc.changed('name')) {
             return createChanspy(doc, options);
           }
         })
         .then(function() {
-          if (!doc.chanspy && options.changed.chanspy) {
+          if (!doc.chanspy && doc.changed('chanspy')) {
             return deleteChanSpy(doc, options);
           }
         })
     }
-  });
+  })
 }
 
 function createChanspy(doc, options) {
@@ -118,7 +118,6 @@ function createChanspy(doc, options) {
           type: 'system'
         });
         bulkSpies.push(VoiceExtension.bulkCreate(spies, {
-          raw: true,
           transaction: options.transaction
         }));
       });
@@ -137,7 +136,6 @@ function deleteChanSpy(doc, options) {
           $ne: null
         }
       },
-      raw: true,
       transaction: options.transaction
     });
 }
@@ -145,13 +143,13 @@ function deleteChanSpy(doc, options) {
 function createCallerID(doc, options) {
   return function() {
     // devo aspettare che ci siano entrambi i campi
-    if (doc.fullname && doc.internal && options.changed.fullname) {
+    if (doc.fullname && doc.internal && doc.changed('fullname')) {
       console.log('Creating callerID...');
       doc.callerid = util.format('"%s" <%s>', doc.fullname, doc.internal);
       return doc.save({
-        raw: true,
-        transaction: options.transaction || null
+        transaction: options.transaction
       });
+      // console.log('callerid created');
     }
 
     return;
@@ -213,8 +211,7 @@ function createExtension(doc, options) {
 
     return VoiceExtension
       .bulkCreate(userDials, {
-        raw: true,
-        transaction: options.transaction || null
+        transaction: options.transaction
       })
   }
 }
index 91fe887..df65e21 100644 (file)
@@ -71,7 +71,7 @@ function Chat() {
   });
 }
 
-// Chat.prototype.http = function(action, doc) {
+// Chat.prototype.http = function(action, dataValues) {
 //   var options = {
 //     method: action.data1,
 //     uri: action.data2,
@@ -80,10 +80,10 @@ function Chat() {
 //
 //   switch (action.data1) {
 //     case 'GET':
-//       options.qs = doc;
+//       options.qs = dataValues;
 //       break;
 //     case 'POST':
-//       options.form = doc;
+//       options.form = dataValues;
 //       break;
 //     default:
 //   }
@@ -94,13 +94,13 @@ function Chat() {
 //     });
 // }
 
-Chat.prototype.tag = function(action, doc) {
+Chat.prototype.tag = function(action, dataValues) {
   return ChatRoom
     .update({
       tags: action.data1.split(';')
     }, {
       where: {
-        id: doc.id
+        id: dataValues.id
       }
     })
     .catch(function(err) {
@@ -108,7 +108,7 @@ Chat.prototype.tag = function(action, doc) {
     });
 }
 
-Chat.prototype.accountEmail = function(action, doc) {
+Chat.prototype.accountEmail = function(action, dataValues) {
   return MailAccount
     .findById(action.data1)
     .then(function(mailAccount) {
@@ -119,7 +119,7 @@ Chat.prototype.accountEmail = function(action, doc) {
           to: action.data2.split(';'),
           cc: action.data3 ? action.data3.split(';') : [],
           html: action.data5 ? Mustache
-            .render(action.data5, doc)
+            .render(action.data5, dataValues)
             .replace(/&/g, '&amp;')
             .replace(/</g, '&lt;')
             .replace(/>/g, '&gt;')
@@ -137,7 +137,7 @@ Chat.prototype.accountEmail = function(action, doc) {
     });
 }
 
-Chat.prototype.close = function(action, doc) {
+Chat.prototype.close = function(action, dataValues) {
   return ChatRoom
     .update({
       status: 'CLOSED',
@@ -145,7 +145,7 @@ Chat.prototype.close = function(action, doc) {
     }, {
       individualHooks: true,
       where: {
-        id: doc.id
+        id: dataValues.id
       }
     })
     .catch(function(err) {
index a369d59..125a065 100644 (file)
@@ -2,7 +2,6 @@
 
 var _ = require('lodash');
 var Mustache = require('mustache');
-var emitter = require('cluster-emitter');
 
 var Util = require('./util');
 var Voice = require('./voice');
@@ -50,7 +49,7 @@ module.exports = function(ami) {
     .scope('all')
     .findAll()
     .then(function(triggers) {
-      _triggers = _.map(triggers, 'dataValues');
+      _triggers = triggers;
       return synchTriggers(_triggers);
     })
     .then(function() {
@@ -58,65 +57,55 @@ module.exports = function(ami) {
     })
     .then(function() {
       console.log('Triggers are ', _triggers.length);
-      emitter.on('ChatRoom.afterCreate', function(doc) {
-        doc = doc.dataValues || doc;
-        return ChatRoom
-          .findById(doc.id)
-          .then(function(chatRoom) {
-            return chatRoom
-              .getChatVisitor();
-          })
+      ChatRoom.afterCreate(function(chatRoom) {
+        return chatRoom
+          .getChatVisitor()
           .then(function(chatVisitor) {
-            var actions = util.getActionsByTriggers(chatVisitor.dataValues, _.filter(_triggers, {
+            var actions = util.getActionsByTriggers(chatVisitor, _.filter(_triggers, {
               channel: 'chat'
             }));
-            execActions(actions, _.merge(chatVisitor.dataValues, doc), 'chat', null, util, voice, mail, cm, jscripty, integration, urlForward, chat);
+            execActions(actions, _.merge(chatVisitor.dataValues, chatRoom.dataValues), 'chat', null, util, voice, mail, cm, jscripty, integration, urlForward, chat);
           })
           .catch(function(err) {
             console.error(err);
           });
       });
-      emitter.on('SmsMessage.afterCreate', function(doc) {
-        if (doc.status === 'RECEIVED') {
-          doc = doc.dataValues || doc;
-          var actions = util.getActionsByTriggers(doc, _.filter(_triggers, {
+      SmsMessage.afterCreate(function(smsMessage) {
+        if (smsMessage.status === 'RECEIVED') {
+          var actions = util.getActionsByTriggers(smsMessage, _.filter(_triggers, {
             channel: 'sms'
           }));
-          execActions(actions, doc, 'sms', null, util, voice, mail, cm, jscripty, integration, urlForward, chat, sms);
+          execActions(actions, smsMessage.dataValues, 'sms', null, util, voice, mail, cm, jscripty, integration, urlForward, chat, sms);
         }
       });
-      emitter.on('ReportDial.afterUpdate', function(doc) {
+      ReportDial.afterUpdate(function(doc) {
         if (doc.channel) {
-          doc = doc.dataValues || doc;
           var actions = util.getActionsByTriggers(doc, _.filter(_triggers, {
             channel: 'voice'
           }));
-          doc.membername = doc.channel.split(/\/|-/)[1];
+          doc.dataValues.membername = doc.channel.split(/\/|-/)[1];
           console.log('After dial update, Actions are ', actions.length);
           execActions(actions, doc, 'voice', 'outbound', util, voice, mail, cm, jscripty, integration, urlForward);
         }
-      });
-      emitter.on('ReportAgent.afterCreate', function(doc) {
-        doc = doc.dataValues || doc;
+      })
+      ReportAgent.afterCreate(function(doc) {
         var actions = util.getActionsByTriggers(doc, _.filter(_triggers, {
           channel: 'voice'
         }));
         console.log('After agent create, Actions are ', actions.length);
         execActions(actions, doc, 'voice', 'queue', util, voice, mail, cm, jscripty, integration, urlForward);
-      });
-      emitter.on('ReportAgent.afterUpdate', function(doc, options) {
-        if (_.includes(options.changed, 'lastevent')) {
-          doc = doc.dataValues || doc;
+      })
+      ReportAgent.afterUpdate(function(doc) {
+        if (doc.changed('lastevent')) {
           var actions = util.getActionsByTriggers(doc, _.filter(_triggers, {
             channel: 'voice'
           }));
           console.log('After agent update, Actions are ', actions.length);
           execActions(actions, doc, 'voice', 'queue', util, voice, mail, cm, jscripty, integration, urlForward);
         }
-      });
-      emitter.on('MailMessage.afterCreate', function(doc) {
+      })
+      MailMessage.afterCreate(function(doc) {
         if (doc.status === 'RECEIVED') {
-          doc = doc.dataValues || doc;
           var actions = util.getActionsByTriggers(doc, _.filter(_triggers, {
             channel: 'mail',
             status: true
@@ -172,15 +161,15 @@ function synchVars(ami) {
 }
 
 function synchVariables(active) {
-  emitter.on('Variable.afterCreate', function(doc) {
+  Variable.afterCreate(function(doc) {
     updateCollection(active, doc);
     console.log('After create, Variables are ', active.length);
   });
-  emitter.on('Variable.afterUpdate', function(doc) {
+  Variable.afterUpdate(function(doc) {
     updateCollection(active, doc);
     console.log('After update, Variables are ', active.length);
   });
-  emitter.on('Variable.afterDestroy', function(doc) {
+  Variable.afterDestroy(function(doc) {
     _.remove(active, {
       id: doc.id
     });
@@ -194,9 +183,9 @@ function getActionVariables(doc, channel) {
     var channelVariables = _.find(callChannels, {
       uniqueid: doc.uniqueid
     });
-    return channelVariables ? _.merge(_.clone(doc), channelVariables.variables) : _.clone(doc);
+    return channelVariables ? _.merge(_.clone(doc.dataValues), channelVariables.variables) : _.clone(doc.dataValues);
   } else {
-    return _.clone(doc);
+    return _.clone(doc.dataValues);
   }
 }
 
@@ -207,23 +196,23 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
     console.log('Executing action "' + action.action + '"');
     switch (action.action) {
       case 'contactManager':
-        cm.manageContact(doc, channel);
+        cm.manageContact(doc.dataValues, channel);
         break;
       case 'urlForward':
       case 'http':
-        urlForward.sendRequest(doc, channel, action, getActionVariables(doc, channel));
+        urlForward.sendRequest(doc.dataValues, channel, action, getActionVariables(doc, channel));
         break;
       case 'jscripty':
-        jscripty.manageJscripty(action.data1, doc, channel);
+        jscripty.manageJscripty(action.data1, doc.dataValues, channel);
         break;
       case 'integration':
       case 'motionbar':
-        integration.manageEvent(action, doc, channel, subtype, getActionVariables(doc, channel));
+        integration.manageEvent(action, doc.dataValues, channel, subtype, getActionVariables(doc, channel));
         break;
       case 'tag':
         switch (channel) {
           case 'mail':
-            mail.tag(action, doc);
+            mail.tag(action, doc.dataValues);
             break;
           case 'chat':
             chat.tag(action, doc);
@@ -238,7 +227,7 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
         // case 'http': //commented cause urlforward does the same, so we don't repeat the same function
         //   switch (channel) {
         //     case 'mail':
-        //       mail.http(action, doc);
+        //       mail.http(action, doc.dataValues);
         //       break;
         //     case 'chat':
         //       chat.http(action, doc);
@@ -251,7 +240,7 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
         //
         //   break;
       case 'email':
-        mail.email(action, doc);
+        mail.email(action, doc.dataValues);
         break;
       case 'accountEmail':
         switch (channel) {
@@ -266,10 +255,10 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
 
         break;
       case 'forward':
-        mail.forward(action, doc);
+        mail.forward(action, doc.dataValues);
         break;
       case 'template':
-        mail.template(action, doc);
+        mail.template(action, doc.dataValues);
         break;
       case 'accountTemplate':
         mail.accountTemplate(action, doc);
@@ -277,7 +266,7 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
       case 'close':
         switch (channel) {
           case 'mail':
-            mail.close(action, doc);
+            mail.close(action, doc.dataValues);
             break;
           case 'chat':
             chat.close(action, doc);
@@ -297,20 +286,20 @@ function execActions(actions, doc, channel, subtype, util, voice, mail, cm, jscr
 }
 
 function synchTriggers(triggers) {
-  emitter.on('Trigger.afterCreate', function(doc, options) {
+  Trigger.afterCreate(function(doc, options) {
     options.newTrigger.id = doc.id;
     triggers.push(options.newTrigger);
   });
-  emitter.on('Trigger.afterUpdate', function(doc) {
+  Trigger.afterUpdate(function(doc, options) {
     updateCollection(triggers, doc);
   });
-  emitter.on('Trigger.afterDestroy', function(doc) {
+  Trigger.afterDestroy(function(doc) {
     _.remove(triggers, {
       id: doc.id
     });
   });
-  emitter.on('ToolsAction.afterBulkDestroy', function(doc, options) {
-    var triggerId = parseInt(options.TriggerId);
+  ToolsAction.afterBulkDestroy(function(doc) {
+    var triggerId = parseInt(doc.where.TriggerId);
     var triggerFound = _.find(triggers, function(obj) {
       return obj.id === triggerId;
     });
@@ -318,7 +307,7 @@ function synchTriggers(triggers) {
       triggerFound.Actions = [];
     }
   });
-  emitter.on('ToolsAction.afterBulkCreate', function(doc) {
+  ToolsAction.afterBulkCreate(function(doc) {
     _.forEach(doc, function(action) {
       var triggerFound = _.find(triggers, function(obj) {
         return obj.id === parseInt(action.TriggerId);
@@ -328,17 +317,17 @@ function synchTriggers(triggers) {
       }
     });
   });
-  emitter.on('ToolsCondition.afterBulkDestroy', function(doc, options) {
-    if (options.hasOwnProperty('TriggerAllId')) {
-      var triggerAllId = parseInt(options.TriggerAllId);
+  ToolsCondition.afterBulkDestroy(function(doc) {
+    if (doc.where.hasOwnProperty('TriggerAllId')) {
+      var triggerAllId = parseInt(doc.where.TriggerAllId);
       var triggerAllFound = _.find(triggers, function(obj) {
         return obj.id === triggerAllId;
       });
       if (triggerAllFound) {
         triggerAllFound.All = [];
       }
-    } else if (options.hasOwnProperty('TriggerAnyId')) {
-      var triggerAnyId = parseInt(options.TriggerAnyId);
+    } else if (doc.where.hasOwnProperty('TriggerAnyId')) {
+      var triggerAnyId = parseInt(doc.where.TriggerAnyId);
       var triggerAnyFound = _.find(triggers, function(obj) {
         return obj.id === triggerAnyId;
       });
@@ -347,18 +336,18 @@ function synchTriggers(triggers) {
       }
     }
   });
-  emitter.on('ToolsCondition.afterBulkCreate', function(doc, options) {
+  ToolsCondition.afterBulkCreate(function(doc) {
     _.forEach(doc, function(condition) {
-      if (condition.hasOwnProperty('TriggerAllId')) {
-        var triggerAllId = parseInt(condition.TriggerAllId);
+      if (condition.dataValues.hasOwnProperty('TriggerAllId')) {
+        var triggerAllId = parseInt(condition.dataValues.TriggerAllId);
         var triggerAllFound = _.find(triggers, function(obj) {
           return obj.id === triggerAllId;
         });
         if (triggerAllFound) {
           triggerAllFound.All.push(condition);
         }
-      } else if (condition.hasOwnProperty('TriggerAnyId')) {
-        var triggerAnyId = parseInt(condition.TriggerAnyId);
+      } else if (condition.dataValues.hasOwnProperty('TriggerAnyId')) {
+        var triggerAnyId = parseInt(condition.dataValues.TriggerAnyId);
         var triggerAnyFound = _.find(triggers, function(obj) {
           return obj.id === triggerAnyId;
         });
@@ -367,7 +356,7 @@ function synchTriggers(triggers) {
         }
       }
     });
-  });
+  })
 }
 
 function updateCollection(collection, doc) {
index d270019..4b521e4 100644 (file)
@@ -12,13 +12,13 @@ function Mail() {
   console.log('Trigger Mail Initialization...');
 }
 
-Mail.prototype.tag = function(action, doc, channel, subtype) {
+Mail.prototype.tag = function(action, dataValues, channel, subtype) {
   return MailRoom
     .update({
       tags: action.data1.split(';')
     }, {
       where: {
-        id: doc.MailRoomId
+        id: dataValues.MailRoomId
       }
     })
     .catch(function(err) {
@@ -26,7 +26,7 @@ Mail.prototype.tag = function(action, doc, channel, subtype) {
     });
 }
 
-// Mail.prototype.http = function(action, doc) {
+// Mail.prototype.http = function(action, dataValues) {
 //   var options = {
 //     method: action.data1,
 //     uri: action.data2,
@@ -35,10 +35,10 @@ Mail.prototype.tag = function(action, doc, channel, subtype) {
 //
 //   switch (action.data1) {
 //     case 'GET':
-//       options.qs = doc;
+//       options.qs = dataValues;
 //       break;
 //     case 'POST':
-//       options.form = doc;
+//       options.form = dataValues;
 //       break;
 //     default:
 //   }
@@ -49,9 +49,9 @@ Mail.prototype.tag = function(action, doc, channel, subtype) {
 //     });
 // }
 
-Mail.prototype.email = function(action, doc) {
+Mail.prototype.email = function(action, dataValues) {
   return MailAccount
-    .findById(doc.accountId)
+    .findById(dataValues.accountId)
     .then(function(mailAccount) {
 
       return MailMessage
@@ -61,7 +61,7 @@ Mail.prototype.email = function(action, doc) {
           to: action.data1.split(';'),
           cc: action.data2 ? action.data2.split(';') : [],
           html: action.data4 ? Mustache
-            .render(action.data4, doc)
+            .render(action.data4, dataValues)
             .replace(/&/g, '&amp;')
             .replace(/</g, '&lt;')
             .replace(/>/g, '&gt;')
@@ -79,17 +79,17 @@ Mail.prototype.email = function(action, doc) {
     });
 }
 
-Mail.prototype.forward = function(action, doc) {
+Mail.prototype.forward = function(action, dataValues) {
   return MailAccount
-    .findById(doc.accountId)
+    .findById(dataValues.accountId)
     .then(function(mailAccount) {
       return MailMessage
         .create({
-          subject: doc.subject || null,
+          subject: dataValues.subject || null,
           from: [mailAccount.address],
-          fromId: doc.fromId,
+          fromId: dataValues.fromId,
           to: action.data1.split(';'),
-          text: doc
+          text: dataValues
             .text
             .replace(/&/g, '&amp;')
             .replace(/</g, '&lt;')
@@ -97,7 +97,7 @@ Mail.prototype.forward = function(action, doc) {
             .replace(/"/g, '&quot;')
             .replace(/'/g, '&#039;')
             .replace(/\n/g, '<br>'),
-          html: doc.html,
+          html: dataValues.html,
           status: 'SENDING',
           auto: true,
           accountId: mailAccount.id,
@@ -109,11 +109,11 @@ Mail.prototype.forward = function(action, doc) {
     });
 }
 
-Mail.prototype.template = function(action, doc) {
+Mail.prototype.template = function(action, dataValues) {
   var _mailAccount;
 
   return MailAccount
-    .findById(doc.accountId)
+    .findById(dataValues.accountId)
     .then(function(mailAccount) {
       _mailAccount = mailAccount;
       return Template
@@ -126,7 +126,7 @@ Mail.prototype.template = function(action, doc) {
           subject: template.subject,
           from: [_mailAccount.address],
           to: action.data2.split(';'),
-          html: template.html ? Mustache.render(template.html, doc) : null,
+          html: template.html ? Mustache.render(template.html, dataValues) : null,
           auto: true,
           accountId: _mailAccount.id,
           accountName: _mailAccount.name
@@ -137,7 +137,7 @@ Mail.prototype.template = function(action, doc) {
     });
 }
 
-Mail.prototype.accountTemplate = function(action, doc) {
+Mail.prototype.accountTemplate = function(action, dataValues) {
   var _mailAccount;
 
   return MailAccount
@@ -154,7 +154,7 @@ Mail.prototype.accountTemplate = function(action, doc) {
           subject: template.subject,
           from: [_mailAccount.address],
           to: action.data3.split(';'),
-          html: template.html ? Mustache.render(template.html, doc) : null,
+          html: template.html ? Mustache.render(template.html, dataValues) : null,
           auto: true,
           accountId: _mailAccount.id,
           accountName: _mailAccount.name,
@@ -165,7 +165,7 @@ Mail.prototype.accountTemplate = function(action, doc) {
     });
 }
 
-Mail.prototype.close = function(action, doc) {
+Mail.prototype.close = function(action, dataValues) {
   return MailRoom
     .update({
       status: 'CLOSED',
@@ -173,7 +173,7 @@ Mail.prototype.close = function(action, doc) {
     }, {
       individualHooks: true,
       where: {
-        id: doc.MailRoomId
+        id: dataValues.MailRoomId
       }
     })
     .catch(function(err) {
index f7b27e5..3a2dff7 100644 (file)
@@ -11,7 +11,7 @@ function Sms() {
   console.log('Trigger Sms Initialization...');
 }
 
-// Sms.prototype.http = function(action, doc) {
+// Sms.prototype.http = function(action, dataValues) {
 //   var options = {
 //     method: action.data1,
 //     uri: action.data2,
@@ -20,10 +20,10 @@ function Sms() {
 //
 //   switch (action.data1) {
 //     case 'GET':
-//       options.qs = doc;
+//       options.qs = dataValues;
 //       break;
 //     case 'POST':
-//       options.form = doc;
+//       options.form = dataValues;
 //       break;
 //     default:
 //   }
@@ -34,13 +34,13 @@ function Sms() {
 //     });
 // }
 
-Sms.prototype.tag = function(action, doc) {
+Sms.prototype.tag = function(action, dataValues) {
   return SmsRoom
     .update({
       tags: action.data1.split(';')
     }, {
       where: {
-        id: doc.SmsRoomId
+        id: dataValues.SmsRoomId
       }
     })
     .catch(function(err) {
@@ -48,7 +48,7 @@ Sms.prototype.tag = function(action, doc) {
     });
 }
 
-Sms.prototype.close = function(action, doc) {
+Sms.prototype.close = function(action, dataValues) {
   return SmsRoom
     .update({
       status: 'CLOSED',
@@ -56,7 +56,7 @@ Sms.prototype.close = function(action, doc) {
     }, {
       individualHooks: true,
       where: {
-        id: doc.SmsRoomId
+        id: dataValues.SmsRoomId
       }
     })
     .catch(function(err) {
@@ -64,7 +64,7 @@ Sms.prototype.close = function(action, doc) {
     });
 }
 
-Sms.prototype.accountEmail = function(action, doc) {
+Sms.prototype.accountEmail = function(action, dataValues) {
   return MailAccount
     .findById(action.data1)
     .then(function(mailAccount) {
@@ -75,7 +75,7 @@ Sms.prototype.accountEmail = function(action, doc) {
           to: action.data2.split(';'),
           cc: action.data3 ? action.data3.split(';') : [],
           html: action.data5 ? Mustache
-            .render(action.data5, doc)
+            .render(action.data5, dataValues)
             .replace(/&/g, '&amp;')
             .replace(/</g, '&lt;')
             .replace(/>/g, '&gt;')
@@ -93,7 +93,7 @@ Sms.prototype.accountEmail = function(action, doc) {
     });
 }
 
-Sms.prototype.accountTemplate = function(action, doc) {
+Sms.prototype.accountTemplate = function(action, dataValues) {
   var _mailAccount;
 
   return MailAccount
@@ -110,7 +110,7 @@ Sms.prototype.accountTemplate = function(action, doc) {
           subject: template.subject,
           from: [_mailAccount.address],
           to: action.data3.split(';'),
-          html: template.html ? Mustache.render(template.html, doc) : null,
+          html: template.html ? Mustache.render(template.html, dataValues) : null,
           auto: true,
           accountId: _mailAccount.id,
           accountName: _mailAccount.name,
index d1bf7be..97bd1dc 100644 (file)
@@ -8,18 +8,18 @@ function Util() {
 
 Util.prototype.getActionsByTriggers = function(doc, triggers) {
   var actions = [];
-  doc.from = doc.from ? doc.from.split(';') : [];
-  doc.cc = doc.cc ? doc.cc.split(';') : [];
-  doc.to = doc.to ? doc.to.split(';') : [];
+  doc.dataValues.from = doc.dataValues.from ? doc.dataValues.from.split(';') : [];
+  doc.dataValues.cc = doc.dataValues.cc ? doc.dataValues.cc.split(';') : [];
+  doc.dataValues.to = doc.dataValues.to ? doc.dataValues.to.split(';') : [];
   triggers.forEach(function(trigger) {
     if (trigger.status) {
       var All = [];
       var Any = [];
       trigger.All.forEach(function(condition) {
-        All.push(checkCondition(condition, doc));
+        All.push(checkCondition(condition.dataValues || condition, doc.dataValues));
       });
       trigger.Any.forEach(function(condition) {
-        Any.push(checkCondition(condition, doc));
+        Any.push(checkCondition(condition.dataValues || condition, doc.dataValues));
       });
 
       var allResult = [],
@@ -42,9 +42,9 @@ Util.prototype.getActionsByTriggers = function(doc, triggers) {
       }
     }
   });
-  doc.from = doc.from.join(';');
-  doc.cc = doc.cc.join(';');
-  doc.to = doc.to.join(';');
+  doc.dataValues.from = doc.dataValues.from.join(';');
+  doc.dataValues.cc = doc.dataValues.cc.join(';');
+  doc.dataValues.to = doc.dataValues.to.join(';');
   //return actions array
   return actions;
 }
index 3e20e34..9bae5b3 100644 (file)
@@ -1,25 +1,31 @@
-'use strict';
-
-var emitter = require('cluster-emitter');
+/**
+ * Action Model
+ */
 
 module.exports = function(sequelize, DataTypes) {
 
        var Action = sequelize.define('Action', {
-               name: DataTypes.STRING,
-               data1: DataTypes.STRING,
-               data2: DataTypes.STRING,
-               data3: DataTypes.STRING,
-               data4: DataTypes.STRING,
-               data5: DataTypes.STRING
+               name: {
+                       type: DataTypes.STRING
+               },
+               data1: {
+                       type: DataTypes.STRING
+               },
+               data2: {
+                       type: DataTypes.STRING
+               },
+               data3: {
+                       type: DataTypes.STRING
+               },
+               data4: {
+                       type: DataTypes.STRING
+               },
+               data5: {
+                       type: DataTypes.STRING
+               }
        }, {
                tableName: 'actions',
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('Action.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       }
-               }
+               associate: function(models) {}
        });
 
        return Action;
index 85a6341..d42d28c 100644 (file)
@@ -1,6 +1,8 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const emitter = require('cluster-emitter');
+var crypto = require('crypto');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -49,11 +51,6 @@ module.exports = function(sequelize, DataTypes) {
                website: DataTypes.STRING
        }, {
                tableName: 'chat_rooms',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('ChatRoom.afterCreate', doc);
-                       }
-               },
                associate: function(models) {
                        ChatRoom.hasMany(models.ChatMessage);
                        ChatRoom.belongsTo(models.ChatVisitor);
@@ -74,19 +71,6 @@ module.exports = function(sequelize, DataTypes) {
                                        }]
                                }
                        });
-               },
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('ChatRoom.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('ChatRoom.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('ChatRoom.afterDestroy', doc);
-                       }
                }
        });
 
index c0f8d39..079db3f 100644 (file)
@@ -1,7 +1,8 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const crypto = require('crypto');
-const emitter = require('cluster-emitter');
+var crypto = require('crypto');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -127,19 +128,7 @@ module.exports = function(sequelize, DataTypes) {
                                        }]
                                }]
                        });
-               },
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('FaxAccount.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('FaxAccount.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('FaxAccount.afterDestroy', doc);
-                       }
+
                }
        });
 
index 430e0f8..17b8c88 100644 (file)
@@ -1,7 +1,8 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const _ = require('lodash');
-const emitter = require('cluster-emitter');
+var _ = require('lodash');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -59,19 +60,6 @@ module.exports = function(sequelize, DataTypes) {
                        });
                        FaxMessage.belongsTo(models.User);
                        FaxMessage.hasMany(models.FaxAttachment);
-               },
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('FaxMessage.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('FaxMessage.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('FaxMessage.afterDestroy', doc);
-                       }
                }
        });
 
index c25a20d..5c541d5 100644 (file)
@@ -1,9 +1,11 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const _ = require('lodash');
-const emitter = require('cluster-emitter');
+var _ = require('lodash');
 
 module.exports = function(sequelize, DataTypes) {
+
        var MailAccount = sequelize.define('MailAccount', {
                description: DataTypes.STRING,
                name: {
@@ -117,19 +119,6 @@ module.exports = function(sequelize, DataTypes) {
                                        }]
                                }]
                        });
-               },
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('MailAccount.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('MailAccount.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('MailAccount.afterDestroy', doc);
-                       }
                }
        });
 
index 61ff5ec..20a9d5d 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 var _ = require('lodash');
-var emitter = require('cluster-emitter');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -89,11 +88,6 @@ module.exports = function(sequelize, DataTypes) {
                accountName: DataTypes.STRING
        }, {
                tableName: 'mail_messages',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('MailMessage.afterCreate', doc);
-                       }
-               },
                paranoid: true,
                associate: function(models) {
                        MailMessage.hasMany(models.MailAttachment);
index ef70d9a..bc0cfd8 100644 (file)
@@ -1,6 +1,7 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const emitter = require('cluster-emitter');
 const moment = require('moment');
 const satuses = {
        NEW: ['OPEN', 'CLOSED'],
@@ -120,19 +121,6 @@ module.exports = function(sequelize, DataTypes) {
                                        attributes: ['id', 'name', 'fullname', 'email', 'userpic']
                                }]
                        });
-               },
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('MailRoom.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('MailRoom.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('MailRoom.afterDestroy', doc);
-                       }
                }
        });
 
index 7de560f..0f5a9ad 100644 (file)
@@ -1,6 +1,8 @@
-'use strict';
+/**
+ * Chat Website Model
+ */
 
-const emitter = require('cluster-emitter');
+var crypto = require('crypto');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -62,20 +64,7 @@ module.exports = function(sequelize, DataTypes) {
                        defaultValue: true
                }
        }, {
-               tableName: 'mail_servers_in',
-               hooks: {
-                       afterCreate: function(doc, options) {
-                               emitter.to(['master']).emit('MailServerIn.afterCreate', doc, {
-                                       body: options.body
-                               });
-                       },
-                       afterUpdate: function(doc, options) {
-                               emitter.to(['master']).emit('MailServerIn.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc, options) {
-                               emitter.to(['master']).emit('MailServerIn.afterDestroy', doc);
-                       }
-               }
+               tableName: 'mail_servers_in'
        });
 
        return MailServerIn;
index 55a844f..cb5da6e 100644 (file)
@@ -1,8 +1,6 @@
 /**
  *
  */
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
        var MailServerOut = sequelize.define('MailServerOut', {
@@ -24,18 +22,7 @@ module.exports = function(sequelize, DataTypes) {
                },
                source: DataTypes.STRING
        }, {
-               tableName: 'mail_servers_out',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('MailServerOut.afterCreate', doc);
-                       },
-                       afterUpdate: function(doc) {
-                               emitter.to(['master']).emit('MailServerOut.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc) {
-                               emitter.to(['master']).emit('MailServerOut.afterDestroy', doc);
-                       }
-               }
+               tableName: 'mail_servers_out'
        });
 
        return MailServerOut;
index 64228d9..c370eaf 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-const emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
   var Network = sequelize.define('Network', {
     type: DataTypes.ENUM('localnet', 'externip'),
@@ -19,19 +17,6 @@ module.exports = function(sequelize, DataTypes) {
           type: 'externip'
         }
       }
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('NetWork.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('NetWork.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('NetWork.afterDestroy', doc);
-      }
     }
   });
 
index 268a27b..f9bd42d 100644 (file)
@@ -2,8 +2,6 @@
  * Agent Log Model
  */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var ReportAgent = sequelize.define('ReportAgent', {
@@ -66,16 +64,6 @@ module.exports = function(sequelize, DataTypes) {
     answeredelsewheremembername: DataTypes.STRING
   }, {
     tableName: 'report_agent',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('ReportAgent.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('ReportAgent.afterUpdate', doc, {
-          changed: doc.changed()
-        });
-      }
-    },
     indexes: [{
       fields: ['uniqueid', 'destuniqueid']
     }]
index c918e3e..200fb4c 100644 (file)
@@ -2,8 +2,6 @@
  * DIAL Model
  */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var ReportDial = sequelize.define('ReportDial', {
@@ -45,11 +43,6 @@ module.exports = function(sequelize, DataTypes) {
     routeId: DataTypes.INTEGER
   }, {
     tableName: 'report_dial',
-    hooks: {
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('ReportDial.afterUpdate', doc);
-      }
-    },
     indexes: [{
       fields: ['uniqueid']
     }]
index d6f5aaf..e16e62e 100644 (file)
@@ -1,9 +1,11 @@
-'use strict';
+/**
+ * Agent Log Model
+ */
 
-const moment = require('moment');
-const emitter = require('cluster-emitter');
+var moment = require('moment');
 
 module.exports = function(sequelize, DataTypes) {
+
   var ReportMail = sequelize.define('ReportMail', {
     uniqueid: DataTypes.STRING,
     timeslot: DataTypes.INTEGER,
@@ -42,20 +44,7 @@ module.exports = function(sequelize, DataTypes) {
     connectedAt: DataTypes.DATE,
     from: DataTypes.STRING
   }, {
-    tableName: 'report_mail',
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('ReportMail.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('ReportMail.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('ReportMail.afterDestroy', doc);
-      }
-    }
+    tableName: 'report_mail'
   });
 
   return ReportMail;
index ea6c605..d432711 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 var moment = require('moment');
-var emitter = require('cluster-emitter');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -38,16 +37,9 @@ module.exports = function(sequelize, DataTypes) {
     uniqueid: DataTypes.STRING
   }, {
     tableName: 'report_member',
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('ReportMember.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('ReportMember.afterUpdate', doc);
-      }
-    }
+    // indexes: [{
+    //   fields: ['membername', 'enterdate', 'exitdate']
+    // }]
   });
 
   return ReportMember;
index 224e110..4b9c61a 100644 (file)
@@ -1,7 +1,8 @@
-'use strict';
+/**
+ * QueueLog Model
+ */
 
-const emitter = require('cluster-emitter');
-const moment = require('moment');
+var moment = require('moment');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -81,19 +82,6 @@ module.exports = function(sequelize, DataTypes) {
             queuecallerleaveAt: null
           }
         });
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master', 'self']).emit('ReportQueue.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('ReportQueue.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('ReportQueue.afterDestroy', doc);
-      }
     }
   });
 
index b53d4f0..7e38044 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
   var SmsAccount = sequelize.define('SmsAccount', {
     name: {
@@ -75,17 +73,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'sms_accounts',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('SmsAccount.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('SmsAccount.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('SmsAccount.afterDestroy', doc);
-      }
-    },
     associate: function(models) {
       SmsAccount.hasMany(models.SmsRoom);
       SmsAccount.hasMany(models.SmsApplication, {
index f4072e4..7759a0b 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
   var SmsMessage = sequelize.define('SmsMessage', {
     from: {
@@ -35,11 +33,6 @@ module.exports = function(sequelize, DataTypes) {
     },
   }, {
     tableName: 'sms_messages',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('SmsMessage.afterCreate', doc);
-      }
-    },
     associate: function(models) {
       SmsMessage.belongsTo(models.User);
       SmsMessage.belongsTo(models.SmsRoom, {
index c6bf132..a8a9bf8 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var SquareOdbc = sequelize.define('SquareOdbc', {
@@ -18,18 +16,7 @@ module.exports = function(sequelize, DataTypes) {
     },
     description: DataTypes.STRING
   }, {
-    tableName: 'square_odbc',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('SquareOdbc.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('SquareOdbc.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('SquareOdbc.afterDestroy', doc);
-      }
-    }
+    tableName: 'square_odbc'
   });
 
   return SquareOdbc;
index 61dfb71..7c28c70 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var SquareProject = sequelize.define('SquareProject', {
@@ -25,17 +23,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'square_projects',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('SquareProject.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('SquareProject.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('SquareProject.afterDestroy', doc);
-      }
-    }
   });
 
   return SquareProject;
index 929c747..611871a 100644 (file)
@@ -2,9 +2,6 @@
  * Square recordings Model
  */
 
-var emitter = require('cluster-emitter');
-
-
 var crypto = require('crypto');
 
 module.exports = function(sequelize, DataTypes) {
@@ -23,18 +20,7 @@ module.exports = function(sequelize, DataTypes) {
                filename: DataTypes.STRING,
                savePath: DataTypes.STRING
        }, {
-               tableName: 'square_recordings',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('SquareRecording.afterCreate', doc);
-                       },
-                       afterUpdate: function(doc) {
-                               emitter.to(['master']).emit('SquareRecording.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc) {
-                               emitter.to(['master']).emit('SquareRecording.afterDestroy', doc);
-                       }
-               }
+               tableName: 'square_recordings'
        });
 
        return SquareRecording;
index 6b8f1a1..6ded5d0 100644 (file)
@@ -3,7 +3,6 @@
  */
 
 var crypto = require('crypto');
-var emitter = require('cluster-emitter');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -13,18 +12,7 @@ module.exports = function(sequelize, DataTypes) {
                subject: DataTypes.STRING,
                html: DataTypes.TEXT
        }, {
-               tableName: 'tools_templates',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('Template.afterCreate', doc);
-                       },
-                       afterUpdate: function(doc) {
-                               emitter.to(['master']).emit('Template.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc) {
-                               emitter.to(['master']).emit('Template.afterDestroy', doc);
-                       }
-               }
+               tableName: 'tools_templates'
        });
 
        return Template;
index 9e04d3f..aaeece0 100644 (file)
@@ -2,8 +2,6 @@
  * Tools Actions Model
  */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var ToolsAction = sequelize.define('ToolsAction', {
@@ -26,17 +24,7 @@ module.exports = function(sequelize, DataTypes) {
       type: DataTypes.STRING(4096)
     }
   }, {
-    tableName: 'tools_actions',
-    hooks: {
-      afterBulkCreate: function(doc) {
-        emitter.to(['master']).emit('ToolsAction.afterBulkCreate', doc);
-      },
-      afterBulkDestroy: function(doc) {
-        emitter.to(['master']).emit('ToolsAction.afterBulkDestroy', doc, {
-          TriggerId: doc.where.TriggerId
-        });
-      }
-    }
+    tableName: 'tools_actions'
   });
 
   return ToolsAction;
index 22fe6a9..67c4c74 100644 (file)
@@ -2,8 +2,6 @@
  * Automation Model
  */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var Automation = sequelize.define('Automation', {
@@ -20,17 +18,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'tools_automations',
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('Automation.afterCreate', doc);
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('Automation.afterUpdate', doc);
-      },
-      afterDelete: function(doc, options) {
-        emitter.to(['master']).emit('Automation.afterDelete', doc);
-      }
-    },
     associate: function(models) {
       Automation.hasMany(models.ToolsCondition, {
         as: {
index 50902ba..cb0b603 100644 (file)
@@ -2,7 +2,7 @@
  * Tools Conditions Model
  */
 
-var emitter = require('cluster-emitter');
+var crypto = require('crypto');
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -11,22 +11,7 @@ module.exports = function(sequelize, DataTypes) {
     operator: DataTypes.STRING,
     value: DataTypes.STRING
   }, {
-    tableName: 'tools_conditions',
-    hooks: {
-      afterBulkCreate: function(doc) {
-        emitter.to(['master']).emit('ToolsCondition.afterBulkCreate', doc);
-      },
-      afterBulkDestroy: function(doc) {
-        var options = {};
-        if (doc.where.hasOwnProperty('TriggerAllId')) {
-          options.TriggerAllId = doc.where.TriggerAllId;
-        }
-        if (doc.where.hasOwnProperty('TriggerAnyId')) {
-          options.TriggerAnyId = doc.where.TriggerAnyId;
-        }
-        emitter.to(['master']).emit('ToolsCondition.afterBulkDestroy', doc, options);
-      }
-    }
+    tableName: 'tools_conditions'
   });
 
   return ToolsCondition;
index de98180..bb12e4c 100644 (file)
@@ -1,6 +1,4 @@
-'use strict';
-
-const emitter = require('cluster-emitter');
+/* jshint indent: 2 */
 
 module.exports = function(sequelize, DataTypes) {
   var Interval = sequelize.define('Interval', {
@@ -50,21 +48,9 @@ module.exports = function(sequelize, DataTypes) {
           IntervalId: null
         }
       });
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('Interval.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('Interval.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('Interval.afterDestroy', doc);
-      }
     }
   });
 
+
   return Interval;
 };
index 1f1b075..1cdadf1 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var Schedule = sequelize.define('Schedule', {
@@ -37,17 +35,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'tools_schedules',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('Schedule.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('Schedule.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('Schedule.afterDestroy', doc);
-      }
-    },
     associate: function(models) {
       Schedule.belongsTo(models.MailServerOut);
     }
index 8762e09..1e44ba9 100644 (file)
@@ -1,8 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
-
 module.exports = function(sequelize, DataTypes) {
 
        var Sound = sequelize.define('Sound', {
@@ -32,18 +29,7 @@ module.exports = function(sequelize, DataTypes) {
                converted_bitRate: DataTypes.BIGINT,
                converted_sampleRate: DataTypes.INTEGER
        }, {
-               tableName: 'tools_sounds',
-               hooks: {
-                       afterCreate: function(doc) {
-                               emitter.to(['master']).emit('Sound.afterCreate', doc);
-                       },
-                       afterUpdate: function(doc) {
-                               emitter.to(['master']).emit('Sound.afterUpdate', doc);
-                       },
-                       afterDestroy: function(doc) {
-                               emitter.to(['master']).emit('Sound.afterDestroy', doc);
-                       }
-               }
+               tableName: 'tools_sounds'
        });
 
        return Sound;
index 98dd763..58f32a3 100644 (file)
@@ -2,8 +2,6 @@
  * Trigger Model
  */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var Trigger = sequelize.define('Trigger', {
@@ -16,19 +14,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'tools_triggers',
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('Trigger.afterCreate', doc, {
-          newTrigger: options.newTrigger
-        });
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('Trigger.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('Trigger.afterDestroy', doc);
-      }
-    },
     associate: function(models) {
       Trigger.hasMany(models.ToolsCondition, {
         as: {
index 0987362..ca991ec 100644 (file)
@@ -1,6 +1,8 @@
 'use strict';
 
-const emitter = require('cluster-emitter');
+var crypto = require('crypto');
+var md5 = require('md5');
+var _ = require('lodash');
 
 module.exports = function(sequelize, DataTypes) {
   var Trunk = sequelize.define('Trunk', {
@@ -462,23 +464,12 @@ module.exports = function(sequelize, DataTypes) {
       type: DataTypes.STRING
     }
   }, {
-    tableName: 'tools_trunks',
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('Trunk.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        if (doc.changed('name')) {
-          throw new Error("You can't modify a trunk name");
-        }
+    tableName: 'tools_trunks'
+  });
 
-        emitter.to(['master']).emit('Trunk.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('Trunk.afterDestroy', doc);
-      }
+  Trunk.beforeUpdate(function(doc) {
+    if (doc.changed('name')) {
+      throw new Error("You can't modify a trunk name");
     }
   });
 
index 8196d55..a874a6d 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var Variable = sequelize.define('Variable', {
@@ -16,17 +14,6 @@ module.exports = function(sequelize, DataTypes) {
     description: DataTypes.STRING
   }, {
     tableName: 'tools_variables',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('Variable.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('Variable.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('Variable.afterDestroy', doc);
-      }
-    },
     associate: function(models) {
       Variable.hasMany(models.ZendeskField);
       Variable.hasMany(models.DeskField);
index 3877344..1d5ee5b 100644 (file)
@@ -5,7 +5,6 @@ var md5 = require('md5');
 var _ = require('lodash');
 var moment = require('moment');
 var VoiceQueue = require('.').VoiceQueue;
-var emitter = require('cluster-emitter');
 
 module.exports = function(sequelize, DataTypes) {
   var User = sequelize.define('User', {
@@ -1066,21 +1065,6 @@ module.exports = function(sequelize, DataTypes) {
         }
         return scope;
       });
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('User.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('User.afterUpdate', doc, {
-          changed: _.keyBy(doc.changed())
-        });
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('User.afterDestroy', doc);
-      }
     }
   });
 
index 16402d2..5b48734 100644 (file)
@@ -1,7 +1,5 @@
 'use strict';
 
-const emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
 
   var ChanSpy = sequelize.define('ChanSpy', {
@@ -29,21 +27,9 @@ module.exports = function(sequelize, DataTypes) {
         onDelete: 'cascade',
         hooks: true
       });
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('ChanSpy.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('ChanSpy.afterUpdate', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('ChanSpy.afterDestroy', doc);
-      }
     }
   });
 
   return ChanSpy;
+
 };
index 9c98115..ed3c5b3 100644 (file)
@@ -1,6 +1,6 @@
-'use strict';
-
-const emitter = require('cluster-emitter');
+/**
+ * Context Model
+ */
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -24,26 +24,8 @@ module.exports = function(sequelize, DataTypes) {
         onDelete: 'cascade',
         hooks: true
       });
-    },
-    hooks: {
-      afterCreate: function(doc, options) {
-        emitter.to(['master']).emit('VoiceContext.afterCreate', doc, {
-          body: options.body
-        });
-      },
-      beforeUpdate: function(doc, options) {
-        emitter.to(['master']).emit('VoiceContext.beforeUpdate', doc);
-      },
-      afterUpdate: function(doc, options) {
-        emitter.to(['master']).emit('VoiceContext.afterUpdate', doc);
-      },
-      beforeDestroy: function(doc, options) {
-        emitter.to(['master']).emit('VoiceContext.beforeDestroy', doc);
-      },
-      afterDestroy: function(doc, options) {
-        emitter.to(['master']).emit('VoiceContext.afterDestroy', doc);
-      }
     }
+
   });
 
   return VoiceContext;
index 4c88b44..b193f1c 100644 (file)
@@ -1,7 +1,5 @@
 /* jshint indent: 2 */
 
-var emitter = require('cluster-emitter');
-
 module.exports = function(sequelize, DataTypes) {
   var VoiceQueue = sequelize.define('VoiceQueue', {
     name: {
@@ -288,17 +286,6 @@ module.exports = function(sequelize, DataTypes) {
     }
   }, {
     tableName: 'voice_queues',
-    hooks: {
-      afterCreate: function(doc) {
-        emitter.to(['master']).emit('VoiceQueue.afterCreate', doc);
-      },
-      afterUpdate: function(doc) {
-        emitter.to(['master']).emit('VoiceQueue.afterUpdate', doc);
-      },
-      afterDestroy: function(doc) {
-        emitter.to(['master']).emit('VoiceQueue.afterDestroy', doc);
-      }
-    },
     associate: function(models) {
       VoiceQueue.belongsToMany(models.User, {
         through: models.UserHasVoiceQueue,
index 93b45b8..f4b8fe8 100644 (file)
@@ -11,7 +11,7 @@ var moment = require('moment');
 
 module.exports = function(app, ami) {
   var env = app.get('env');
-  // app.locals.ami = ami;
+  app.locals.ami = ami;
 
   // Insert routes below
   app.use('/api/report/openchannel/sessions', require('./api/report_openchannel_session'));
@@ -148,7 +148,8 @@ module.exports = function(app, ami) {
   app.use('/auth', require('./auth'));
 
   // All undefined asset or api routes should return a 404
-  app.route('/:url(api|auth|components|app|bower_components|assets)/*').get(errors[404]);
+  app.route('/:url(api|auth|components|app|bower_components|assets)/*').get(
+    errors[404]);
 
   // All other routes should redirect to the index.html
   app.all("/*", function(req, res, next) {
index a3d53aa..d317e36 100644 (file)
@@ -3,7 +3,7 @@
 const util = require('util');
 const cp = require('child_process');
 
-module.exports = function() {
+module.exports = function(io) {
   const n = cp
     .fork(__dirname + '/workers')
     .on('message', function(data) {
index 0f3a172..a551f89 100644 (file)
@@ -28,9 +28,7 @@ var fonts = {
 };
 
 process.on('message', function(data) {
-  if (data !== 'sticky:balance') {
-    general(data.report, data.query, data.extractedId, data.type.toLowerCase(), data.user)
-  }
+  general(data.report, data.query, data.extractedId, data.type.toLowerCase(), data.user)
 });
 
 function general(report, query, extractedId, type, user) {